@@ -10,8 +10,11 @@ function convert(logger, projectDir, options) {
10
10
options = options || { } ;
11
11
12
12
var sassFilesPath = path . join ( projectDir , 'app/**/*.scss' ) ;
13
- var sassImportPath = path . join ( projectDir , 'app/' ) ;
14
- //console.log("SASS Import Path", sassImportPath);
13
+ var sassImportPaths = [
14
+ path . join ( projectDir , 'app/' ) ,
15
+ path . join ( projectDir , 'node_modules/' )
16
+ ] ;
17
+ //console.log("SASS Import Path", sassImportPaths);
15
18
16
19
var sassFiles = glob . sync ( sassFilesPath ) . filter ( function ( filePath ) {
17
20
var path = filePath ;
@@ -26,7 +29,7 @@ function convert(logger, projectDir, options) {
26
29
} else {
27
30
var i = 0 ;
28
31
var loopSassFilesAsync = function ( sassFiles ) {
29
- parseSass ( sassFiles [ i ] , sassImportPath , function ( e ) {
32
+ parseSass ( sassFiles [ i ] , sassImportPaths , function ( e ) {
30
33
if ( e !== undefined ) {
31
34
//Error in the LESS parser; Reject promise
32
35
reject ( Error ( sassFiles [ i ] + ' SASS CSS pre-processing failed. Error: ' + e ) ) ;
@@ -48,13 +51,13 @@ function convert(logger, projectDir, options) {
48
51
} ) ;
49
52
}
50
53
51
- function parseSass ( filePath , importPath , callback ) {
54
+ function parseSass ( filePath , importPaths , callback ) {
52
55
var sassFileContent = fs . readFileSync ( filePath , { encoding : 'utf8' } ) ;
53
56
var cssFilePath = filePath . replace ( '.scss' , '.css' ) ;
54
57
55
58
sass . render ( {
56
59
data : sassFileContent ,
57
- includePaths : [ importPath ] ,
60
+ includePaths : importPaths ,
58
61
outFile : cssFilePath ,
59
62
outputStyle : 'compressed'
60
63
} , function ( e , output ) {
0 commit comments