File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,13 @@ module.exports = function (content) {
245
245
}
246
246
247
247
// Allow passing custom importers to `node-sass`. Accepts `Function` or an array of `Function`s.
248
- sassOptions . importer = sassOptions . importer ? [ ] . concat ( sassOptions . importer ) : [ ] ;
248
+ sassOptions . importer = sassOptions . importer ? [ ] . concat ( sassOptions . importer ) . map ( function ( importer ) {
249
+ return function ( url , prev , done ) {
250
+ return importer ( url , prev === 'stdin' ? resourcePath : prev , done ) ;
251
+ } ;
252
+ } )
253
+ : [ ]
254
+ ;
249
255
sassOptions . importer . push ( getWebpackImporter ( ) ) ;
250
256
251
257
// `node-sass` uses `includePaths` to resolve `@import` paths. Append the currently processed file.
Original file line number Diff line number Diff line change 2
2
3
3
var should = require ( 'should' ) ;
4
4
5
- function customImporter ( path ) {
5
+ function customImporter ( path , prev ) {
6
6
path . should . equal ( 'import-with-custom-logic' ) ;
7
+ prev . match ( process . cwd ( ) + '/test/(sass|scss)/custom-importer.(scss|sass)' ) . should . not . equal ( null ) ;
7
8
return customImporter . returnValue ;
8
9
}
9
10
customImporter . returnValue = {
You can’t perform that action at this time.
0 commit comments