refactor: route Module structural transformation

This commit is contained in:
vben
2020-11-09 01:08:43 +08:00
parent dc42d434f0
commit 9b61e82d74
9 changed files with 57 additions and 60 deletions

View File

@@ -20,10 +20,11 @@ const dynamicImportTransform = function (env: any = {}): Transform {
return path.includes('/src/utils/helper/dynamicImport.ts');
},
transform({ code }) {
const { VITE_GEN_MENU_MODE = '' } = env;
if (VITE_GEN_MENU_MODE !== 'BACK') {
const { VITE_DYNAMIC_IMPORT } = env;
if (!VITE_DYNAMIC_IMPORT) {
return code;
}
// if (!isBuild) return code;
// Only convert the dir
try {