Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js Vue 3(来自Vue cli)项目-多页&;静态内容构建过程_Vue.js_Webpack_Vue Cli 3_Vuejs3 - Fatal编程技术网

Vue.js Vue 3(来自Vue cli)项目-多页&;静态内容构建过程

Vue.js Vue 3(来自Vue cli)项目-多页&;静态内容构建过程,vue.js,webpack,vue-cli-3,vuejs3,Vue.js,Webpack,Vue Cli 3,Vuejs3,我有一个项目,其中有一个主“应用程序”,它列出并允许动态预览一组“主题” 主题应该单独构建,这样它们可以单独使用,但也可以用于实时定制(比如JS Bin,但用于非常特定的用例) 我的问题: 我希望将每个主题中的theme.json文件复制到每个构建主题文件夹中,理想情况下将“页面”动态包含在vue.config.js文件中,以避免每次都添加新条目 我的网页fu不是很好,所以我可能做这件事完全是为了面子,但欢迎所有的建议:D Myvue.config.js module.exports = {

我有一个项目,其中有一个主“应用程序”,它列出并允许动态预览一组“主题”

主题应该单独构建,这样它们可以单独使用,但也可以用于实时定制(比如JS Bin,但用于非常特定的用例)

我的问题:

我希望将每个主题中的
theme.json
文件复制到每个构建主题文件夹中,理想情况下将“页面”动态包含在
vue.config.js
文件中,以避免每次都添加新条目

我的网页fu不是很好,所以我可能做这件事完全是为了面子,但欢迎所有的建议:D

My
vue.config.js

module.exports = {
    pages: {
        "index": {
            // entry for the page
            entry: 'src/main.js',

            // the source template
            template: 'public/index.html',

            // output as dist/index.html
            filename: 'index.html',

            // when using title option,
            title: 'Index Page',

            // chunks to include on this page, by default includes
            // extracted common chunks and vendor chunks.
            chunks: ['chunk-vendors', 'chunk-common', 'index']
        },
        "sword-shield": {
            // entry for the page
            entry: 'src/themes/sword-shield-team/main.js',

            // the source template
            template: 'src/themes/sword-shield-team/index.html',

            // output as dist/index.html
            filename: 'sword-shield-team/index.html',

            // when using title option,
            title: 'Index Page',

            // chunks to include on this page, by default includes
            // extracted common chunks and vendor chunks.
            chunks: ['chunk-vendors', 'chunk-common', 'sword-shield']
        }
    },
    configureWebpack: {
        plugins: [
            new CopyWebpackPlugin([{
                patterns: [
                    {
                        from: 'src/themes/**/theme.json',
                        to: 'dist/',
                    },
                ]
            }])
        ]
    }
}