We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a87533 commit 90edcd1Copy full SHA for 90edcd1
packages/mars-build/src/gulp-mars-h5.js
@@ -308,7 +308,12 @@ async function compile(file, opt) {
308
allPages.forEach(page => {
309
const name = `_${md5(page).substr(0, 8)}`;
310
// const name = page.replace(/\//g, '$');
311
- content += `import ${name} from './${page}.vue';\n`;
+ if (options._config.h5 && options._config.h5.useLazyRoute) {
312
+ content += `const ${name} = () => import('./${page}.vue');\n`;
313
+ }
314
+ else {
315
+ content += `import ${name} from './${page}.vue';\n`;
316
317
routes.push({
318
path: '/' + page,
319
name
0 commit comments