@@ -57,6 +57,7 @@ class CSSMonster {
5757 content : [ path . resolve ( cwd , "**/*.html" ) ] ,
5858 } ,
5959 blacklist : [ ] ,
60+ include : [ ] ,
6061 } ;
6162 this . run ( ) ;
6263 }
@@ -165,6 +166,19 @@ class CSSMonster {
165166 this . config . purge = false ;
166167 }
167168
169+ /** Included paths */
170+ if ( typeof this . config . include !== "undefined" ) {
171+ if ( typeof config . include === "string" ) {
172+ this . config . include = [ path . resolve ( cwd , config . include ) ] ;
173+ } else if ( Array . isArray ( config . include ) ) {
174+ this . config . include = [ ] ;
175+ for ( let i = 0 ; i < config . include . length ; i ++ ) {
176+ const filePath = path . resolve ( cwd , config . include [ i ] ) ;
177+ this . config . include . push ( filePath ) ;
178+ }
179+ }
180+ }
181+
168182 resolve ( ) ;
169183 } ) ;
170184 }
@@ -232,7 +246,7 @@ class CSSMonster {
232246 if ( fs . existsSync ( `${ this . tempDir } /normalize.css` ) ) {
233247 data = fs . readFileSync ( `${ this . tempDir } /normalize.css` ) . toString ( ) ;
234248 }
235- const normalizePath = path . resolve ( __dirname , "node_modules/normalize.css/normalize.css" ) ;
249+ const normalizePath = path . resolve ( cwd , "node_modules/normalize.css/normalize.css" ) ;
236250 const preflightPath = path . join ( __dirname , "preflight.css" ) ;
237251 data += fs . readFileSync ( normalizePath ) . toString ( ) ;
238252 data += fs . readFileSync ( preflightPath ) . toString ( ) ;
@@ -274,6 +288,7 @@ class CSSMonster {
274288 {
275289 file : file ,
276290 outputStyle : "expanded" ,
291+ includePaths : this . config . include ,
277292 } ,
278293 ( error , result ) => {
279294 if ( error ) {
0 commit comments