@@ -94,13 +94,14 @@ function isProductionLikeMode(loaderContext) {
9494}
9595
9696function proxyCustomImporters ( importers , loaderContext ) {
97- return [ ] . concat ( importers ) . map ( ( importer ) => {
98- return function proxyImporter ( ...args ) {
99- this . webpackLoaderContext = loaderContext ;
97+ return [ ] . concat ( importers ) . map (
98+ ( importer ) =>
99+ function proxyImporter ( ...args ) {
100+ this . webpackLoaderContext = loaderContext ;
100101
101- return importer . apply ( this , args ) ;
102- } ;
103- } ) ;
102+ return importer . apply ( this , args ) ;
103+ }
104+ ) ;
104105}
105106
106107/**
@@ -205,7 +206,14 @@ async function getSassOptions(
205206
206207 options . includePaths = [ ]
207208 . concat ( process . cwd ( ) )
208- . concat ( options . includePaths || [ ] )
209+ . concat (
210+ // We use `includePaths` in context for resolver, so it should be always absolute
211+ ( options . includePaths || [ ] ) . map ( ( includePath ) =>
212+ path . isAbsolute ( includePath )
213+ ? includePath
214+ : path . join ( process . cwd ( ) , includePath )
215+ )
216+ )
209217 . concat (
210218 process . env . SASS_PATH
211219 ? process . env . SASS_PATH . split ( process . platform === "win32" ? ";" : ":" )
@@ -430,11 +438,13 @@ function getWebpackResolver(
430438
431439 resolutionMap = resolutionMap . concat (
432440 // eslint-disable-next-line no-shadow
433- includePaths . map ( ( context ) => ( {
434- resolve : sassResolve ,
435- context,
436- possibleRequests : sassPossibleRequests ,
437- } ) )
441+ includePaths . map ( ( context ) => {
442+ return {
443+ resolve : sassResolve ,
444+ context,
445+ possibleRequests : sassPossibleRequests ,
446+ } ;
447+ } )
438448 ) ;
439449 }
440450
0 commit comments