@@ -162,7 +162,7 @@ function getSassOptions(
162
162
// options.sourceMapRoot = process.cwd();
163
163
options . sourceMapContents = true ;
164
164
options . omitSourceMapUrl = true ;
165
- // options.sourceMapEmbed = false;
165
+ options . sourceMapEmbed = false ;
166
166
}
167
167
168
168
const { resourcePath } = loaderContext ;
@@ -270,16 +270,19 @@ function getPossibleRequests(
270
270
function promiseResolve ( callbackResolve ) {
271
271
return ( context , request ) =>
272
272
new Promise ( ( resolve , reject ) => {
273
- callbackResolve ( context , request , ( err , result ) => {
274
- if ( err ) reject ( err ) ;
275
- else resolve ( result ) ;
273
+ callbackResolve ( context , request , ( error , result ) => {
274
+ if ( error ) {
275
+ reject ( error ) ;
276
+ } else {
277
+ resolve ( result ) ;
278
+ }
276
279
} ) ;
277
280
} ) ;
278
281
}
279
282
280
- const isSpecialModuleImport = / ^ ~ [ ^ / ] + $ / ;
283
+ const IS_SPECIAL_MODULE_IMPORT = / ^ ~ [ ^ / ] + $ / ;
281
284
// `[drive_letter]:\` + `\\[server]\[sharename]\`
282
- const isNativeWin32Path = / ^ [ a - z A - Z ] : [ / \\ ] | ^ \\ \\ / i;
285
+ const IS_NATIVE_WIN32_PATH = / ^ [ a - z ] : [ / \\ ] | ^ \\ \\ / i;
283
286
284
287
/**
285
288
* @public
@@ -373,14 +376,14 @@ function getWebpackResolver(
373
376
374
377
const needEmulateSassResolver =
375
378
// `sass` doesn't support module import
376
- ! isSpecialModuleImport . test ( request ) &&
379
+ ! IS_SPECIAL_MODULE_IMPORT . test ( request ) &&
377
380
// We need improve absolute paths handling.
378
381
// Absolute paths should be resolved:
379
382
// - Server-relative URLs - `<context>/path/to/file.ext` (where `<context>` is root context)
380
383
// - Absolute path - `/full/path/to/file.ext` or `C:\\full\path\to\file.ext`
381
384
! isFileScheme &&
382
385
! originalRequest . startsWith ( '/' ) &&
383
- ! isNativeWin32Path . test ( originalRequest ) ;
386
+ ! IS_NATIVE_WIN32_PATH . test ( originalRequest ) ;
384
387
385
388
if ( includePaths . length > 0 && needEmulateSassResolver ) {
386
389
// The order of import precedence is as follows:
@@ -497,6 +500,10 @@ function getURLType(source) {
497
500
return 'path-absolute' ;
498
501
}
499
502
503
+ if ( IS_NATIVE_WIN32_PATH . test ( source ) ) {
504
+ return 'path-absolute' ;
505
+ }
506
+
500
507
return ABSOLUTE_SCHEME . test ( source ) ? 'absolute' : 'path-relative' ;
501
508
}
502
509
0 commit comments