Closed wbcz closed 7 years ago
一般用路由了才需要分割代码, 把分割代码放在modules/xxx/router/index.js
里就行了.
const index = resolve => { require.ensure(['./../pages/index.vue'], () => { resolve(require('./../pages/index.vue')) }) } const view = resolve => { require.ensure(['./../pages/view.vue'], () => { resolve(require('./../pages/view.vue')) }) }
用古老的写法怎么不行呢,难道webpack2不兼容?but,他是兼容CommonJS写法的啊
本仓库用的是webpack2, 请按上面发的链接里的写法写.
我发现基于这个架构,做单页的代码分割好像不容易,不知道楼主有什么解决办法