如何解决Vue 3来自vue-cli项目-多页和静态内容构建过程
我有一个项目,其中有一个主要的“应用”,该应用列出并允许动态预览一组“主题”。
主题应该单独构建,以便可以单独使用,也可以用于实时自定义(例如JS-Bin,但用于非常特定的用例)。
我的问题:
我希望将每个 theme 中的theme.json
文件复制到每个构建主题文件夹中,理想情况下,将“页面”动态地包含在vue.config.js
文件中以免每次都不必添加新条目。
我的Webpack-fu不太好,所以我可能会完全面对面,但是欢迎所有建议:D
我的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','sword-shield']
}
},configureWebpack: {
plugins: [
new CopyWebpackPlugin([{
patterns: [
{
from: 'src/themes/**/theme.json',to: 'dist/',},]
}])
]
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。