Commit 2a6bbc5 1 parent 4a297f7 commit 2a6bbc5 Copy full SHA for 2a6bbc5
File tree 2 files changed +27
-1
lines changed
core/integration-tests/test
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -399,4 +399,30 @@ describe('sass', function () {
399
399
inputFS : overlayFS ,
400
400
} ) ;
401
401
} ) ;
402
+
403
+ it ( 'should support npm scheme' , async function ( ) {
404
+ const dir = path . join ( __dirname , 'sass-extensions' ) ;
405
+ overlayFS . mkdirp ( dir ) ;
406
+
407
+ await fsFixture ( overlayFS , dir ) `
408
+ index.js:
409
+ import './main.scss';
410
+
411
+ main.scss:
412
+ @use 'npm:test' as test;
413
+
414
+ node_modules/test/package.json:
415
+ { "name": "test" }
416
+
417
+ node_modules/test/_index.scss:
418
+ @use 'other';
419
+
420
+ node_modules/test/_other.scss:
421
+ .foo { color: red }
422
+ ` ;
423
+
424
+ await bundle ( path . join ( dir , '/index.js' ) , {
425
+ inputFS : overlayFS ,
426
+ } ) ;
427
+ } ) ;
402
428
} ) ;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ function resolvePathImporter({
98
98
let containingPath = containingUrl
99
99
? fileURLToPath ( containingUrl )
100
100
: asset . filePath ;
101
- if ( ! containingUrl ) {
101
+ if ( ! containingUrl && url . startsWith ( 'file:' ) ) {
102
102
// If containingUrl is not provided, then url should be an absolute file:/// URL.
103
103
let filePath = fileURLToPath ( url ) ;
104
104
url = path . relative ( path . dirname ( containingPath ) , filePath ) ;
You can’t perform that action at this time.
0 commit comments