嗨,我有一个名为的应用程序Home
,它具有可安装的插件,我可以在任何时间点安装它运行在iframe
<Home /home/user/mainprojects/index.html> <-- Home app
<Bed iframe /home/user/plugins/bed/index.html> <-- plugins app
<Bed /iframe>
</Home>
通过此nginx
设置,我可以在构建后加载插件应用程序(床)(这很耗时)
这是 nginx 设置
location / {
alias /home/user/mainprojects/dist/;
index index.html;
}
location /Bed {
alias /home/user/plugins/bed/dist/;
index index.html index.htm;
}
问题:我不想构建Home
我想通过它运行的主应用程序serve
,但是我将始终构建第二个应用程序,即插件,它将作为捆绑包提供。nginx
在构建两者(即 npm run build,bundle)之后使用上述设置,它将正常工作。我想避免主应用程序构建。
这是我的vue.config.js
样子
module.exports = {
devServer:{
proxy:{
'^/appReplacer':{
target: 'http://100.148.1.9:9003/',
changeOrigin:true,
logLevel:'debug',
pathRewrite: {'^/appReplacer':'/'}
}
}
}
}
还在寻找解决方案。。
请帮助我提前谢谢!