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