-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dynamic-import-vars): simplify the implementation
- Loading branch information
Showing
6 changed files
with
45 additions
and
157 deletions.
There are no files selected for viewing
28 changes: 4 additions & 24 deletions
28
packages/vite/src/node/__tests__/plugins/dynamicImportVar/__snapshots__/parse.test.ts.snap
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,29 +1,9 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`parse positives > alias path 1`] = ` | ||
"__variableDynamicImportRuntimeHelper({ | ||
\\"./mods/hello.js\\": () => import(\\"./mods/hello.js\\"), | ||
\\"./mods/hi.js\\": () => import(\\"./mods/hi.js\\") | ||
}, \`./mods/\${base}.js\`)" | ||
`; | ||
exports[`parse positives > alias path 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\")), \`./mods/\${base}.js\`)"`; | ||
|
||
exports[`parse positives > basic 1`] = ` | ||
"__variableDynamicImportRuntimeHelper({ | ||
\\"./mods/hello.js\\": () => import(\\"./mods/hello.js\\"), | ||
\\"./mods/hi.js\\": () => import(\\"./mods/hi.js\\") | ||
}, \`./mods/\${base}.js\`)" | ||
`; | ||
exports[`parse positives > basic 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\")), \`./mods/\${base}.js\`)"`; | ||
|
||
exports[`parse positives > with query raw 1`] = ` | ||
"__variableDynamicImportRuntimeHelper({ | ||
\\"./mods/hello.js\\": () => import(\\"./mods/hello.js?raw\\"), | ||
\\"./mods/hi.js\\": () => import(\\"./mods/hi.js?raw\\") | ||
}, \`./mods/\${base}.js\`)" | ||
`; | ||
exports[`parse positives > with query raw 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\", {\\"as\\":\\"raw\\",\\"import\\":\\"*\\"})), \`./mods/\${base}.js\`)"`; | ||
|
||
exports[`parse positives > with query url 1`] = ` | ||
"__variableDynamicImportRuntimeHelper({ | ||
\\"./mods/hello.js\\": () => import(\\"./mods/hello.js\\"), | ||
\\"./mods/hi.js\\": () => import(\\"./mods/hi.js\\") | ||
}, \`./mods/\${base}.js\`)" | ||
`; | ||
exports[`parse positives > with query url 1`] = `"__variableDynamicImportRuntimeHelper((import.meta.glob(\\"./mods/*.js\\")), \`./mods/\${base}.js\`)"`; |
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
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
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