Skip to content

Commit

Permalink
Fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Oct 18, 2024
1 parent 16b1fd7 commit b60fe9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/dynamic-import-vars/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function dynamicImportVariables({ include, exclude, warnOnError, errorWhenNoFile
// will turn these into chunks automatically
ms.prepend(
`function __variableDynamicImportRuntime${dynamicImportIndex}__(path) {
path = (${normalizePathString})(path);
const normalPath = (${normalizePathString})(path);
switch (normalPath) {
${paths
.map((p) => ` case '${p}': return import('${p}'${importArg ? `, ${importArg}` : ''});`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`function __variableDynamicImportRuntime0__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand Down Expand Up @@ -43,7 +43,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`function __variableDynamicImportRuntime0__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand All @@ -59,7 +59,7 @@ Generated by [AVA](https://avajs.dev).
case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.js');␊
case './module-dir-b/module-b-1.js': return import('./module-b-1-3qdzaV4G.js');␊
case './module-dir-b/module-b-2.js': return import('./module-b-2-_8gpxG1i.js');␊
case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-3kYiIOy5.js');␊
case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-ULPK6OKR.js');␊
default: return new Promise(function(resolve, reject) {␊
(typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
reject.bind(null, new Error("Unknown variable dynamic import: " + normalPath))␊
Expand All @@ -80,7 +80,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`function __variableDynamicImportRuntime0__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand Down Expand Up @@ -114,7 +114,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`function __variableDynamicImportRuntime0__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand Down Expand Up @@ -150,7 +150,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`function __variableDynamicImportRuntime0__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand Down Expand Up @@ -184,7 +184,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`function __variableDynamicImportRuntime2__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand All @@ -200,7 +200,7 @@ Generated by [AVA](https://avajs.dev).
case './module-dir-a/module-a-2.js': return import('./module-a-2-qepdcyXv.js');␊
case './module-dir-b/module-b-1.js': return import('./module-b-1-3qdzaV4G.js');␊
case './module-dir-b/module-b-2.js': return import('./module-b-2-_8gpxG1i.js');␊
case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-3kYiIOy5.js');␊
case './sub-dir/fixture-upwards-path.js': return import('./fixture-upwards-path-ULPK6OKR.js');␊
default: return new Promise(function(resolve, reject) {␊
(typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(␊
reject.bind(null, new Error("Unknown variable dynamic import: " + normalPath))␊
Expand All @@ -210,7 +210,7 @@ Generated by [AVA](https://avajs.dev).
}␊
␊
function __variableDynamicImportRuntime1__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand All @@ -233,7 +233,7 @@ Generated by [AVA](https://avajs.dev).
}␊
␊
function __variableDynamicImportRuntime0__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand Down Expand Up @@ -305,7 +305,7 @@ Generated by [AVA](https://avajs.dev).
> Snapshot 1
`function __variableDynamicImportRuntime0__(path) {␊
path = (function normalizePath(p) {␊
const normalPath = (function normalizePath(p) {␊
return (␊
p␊
// remove any ./ inside the path␊
Expand Down
Binary file not shown.

0 comments on commit b60fe9e

Please sign in to comment.