我有一个文件夹结构
/resources/assets/js/campaigns/2018/jan/Example.vue
目前正在生成以下内容:
/public/js/chunks/campaigns/2018-jan-Example.js
但是,由于我正在处理的项目的大小,保留文件夹结构并生成它会很好:
/public/js/chunks/campaigns/2018/jan/Example.js
webpack.mix.js
mix.webpackConfig({
output: {
chunkFilename: 'chunks/[name].chunk.js',
publicPath: '/js/'
}
})
mix.js('resources/assets/js/app.js', 'public/js')
Master.vue
methods: {
loadPage(path) {
this.page = () => import( /* webpackChunkName: "campaigns/[request]" */ `../campaigns/${path}`)
},