fix: fix win system dynamicImport error

This commit is contained in:
vben
2020-11-10 00:54:08 +08:00
parent 1093ec3e6e
commit a90d93fc4d
5 changed files with 14 additions and 24 deletions

View File

@@ -17,7 +17,10 @@ const dynamicImportTransform = function (env: any = {}): Transform {
return {
test({ path }) {
// Only convert the file
return path.includes('/src/utils/helper/dynamicImport.ts');
return (
path.includes('/src/utils/helper/dynamicImport.ts') ||
path.includes(`\\src\\utils\\helper\\dynamicImport.ts`)
);
},
transform({ code }) {
const { VITE_DYNAMIC_IMPORT } = env;