Webpack chunkFilename连字符文件路径[名称] - 我可以保持路径完整吗?

时间:2018-02-23 12:28:55

标签: javascript webpack vue.js babeljs laravel-mix

我有一个文件夹结构

/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}`)
        },

0 个答案:

没有答案