File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ export default {
3333 ImportDeclaration : node => {
3434 const importPath = node . source . value
3535 const hasAlias =
36- aliases | > keys | > some ( alias => importPath | > startsWith ( alias ) )
36+ aliases
37+ | > keys
38+ | > some ( alias => importPath | > startsWith ( `${ alias } /` ) )
3739 const resolvedImport = resolvePath ( importPath , path , {
3840 alias : aliases ,
3941 } )
Original file line number Diff line number Diff line change @@ -35,12 +35,12 @@ const runTest = config => () => {
3535}
3636
3737export default {
38- ' external import' : {
38+ external : {
3939 code : endent `
4040 import foo from 'foo'
4141 ` ,
4242 } ,
43- ' parent import' : {
43+ parent : {
4444 code : endent `
4545 import foo from '../foo/bar'
4646 ` ,
@@ -58,7 +58,7 @@ export default {
5858 "Unexpected parent import '../../foo'. No matching alias found to fix the issue" ,
5959 ] ,
6060 } ,
61- 'alias parent import ' : {
61+ 'alias parent' : {
6262 files : {
6363 'foo.js' : '' ,
6464 } ,
@@ -67,7 +67,7 @@ export default {
6767 ` ,
6868 filename : 'sub/index.js' ,
6969 } ,
70- 'alias subpath import ' : {
70+ 'alias subpath' : {
7171 files : {
7272 'foo.js' : '' ,
7373 } ,
@@ -79,4 +79,12 @@ export default {
7979 ] ,
8080 output : "import foo from './foo'" ,
8181 } ,
82+ scoped : {
83+ files : {
84+ 'foo.js' : '' ,
85+ } ,
86+ code : endent `
87+ import foo from '@foo/bar'
88+ ` ,
89+ } ,
8290} | > mapValues ( runTest )
You can’t perform that action at this time.
0 commit comments