File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
core/integration-tests/test Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -399,4 +399,30 @@ describe('sass', function () {
399399 inputFS : overlayFS ,
400400 } ) ;
401401 } ) ;
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+ } ) ;
402428} ) ;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ function resolvePathImporter({
9898 let containingPath = containingUrl
9999 ? fileURLToPath ( containingUrl )
100100 : asset . filePath ;
101- if ( ! containingUrl ) {
101+ if ( ! containingUrl && url . startsWith ( 'file:' ) ) {
102102 // If containingUrl is not provided, then url should be an absolute file:/// URL.
103103 let filePath = fileURLToPath ( url ) ;
104104 url = path . relative ( path . dirname ( containingPath ) , filePath ) ;
You can’t perform that action at this time.
0 commit comments