Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolve dynamicly imported modules to be the same as statically (#…
…911)
- Loading branch information
1 parent
78e66ff
commit 094d23e
Showing
4 changed files
with
32 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
describe('import vue components', () => { | ||
test('normal imports as expected', async() => { | ||
const cmp = await import('../components/Hello.vue') | ||
expect(cmp).toBeDefined() | ||
}) | ||
|
||
test('template string imports as expected', async() => { | ||
// eslint-disable-next-line quotes | ||
const cmp = await import(`../components/Hello.vue`) | ||
expect(cmp).toBeDefined() | ||
}) | ||
|
||
test('dynamic imports as expected', async() => { | ||
const name = 'Hello' | ||
const cmp = await import(`../components/${name}.vue`) | ||
expect(cmp).toBeDefined() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters