集成环境变量作为选项配置的
This commit is contained in:
2
.env.dv
Normal file
2
.env.dv
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VUE_APP_SCOPE=dv
|
||||||
|
VUE_APP_API=http://192.168.1.87:9000
|
||||||
2
.env.fengdu
Normal file
2
.env.fengdu
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VUE_APP_SCOPE=fengdu
|
||||||
|
VUE_APP_API=https://web.fdfengshou.cn/
|
||||||
@@ -5,9 +5,8 @@
|
|||||||
"author": "kubbo",
|
"author": "kubbo",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
"dev:dv": "set VUE_APP_SCOPE=dv&&vue-cli-service serve",
|
"dev:dv": "vue-cli-service serve --mode dv",
|
||||||
"dev87:dv": "export VUE_APP_SCOPE=dv&&vue-cli-service serve",
|
"dev:fengdu": "vue-cli-service serve --mode fengdu",
|
||||||
"dev:fengdu": "set VUE_APP_SCOPE=fengdu&&vue-cli-service serve",
|
|
||||||
"lib": "npm publish||(npm unpublish -f&&npm publish)",
|
"lib": "npm publish||(npm unpublish -f&&npm publish)",
|
||||||
"ui": "npm run lib -w ui&&npm i dui@latest",
|
"ui": "npm run lib -w ui&&npm i dui@latest",
|
||||||
"sync": "node bin/appsSync.js"
|
"sync": "node bin/appsSync.js"
|
||||||
|
|||||||
@@ -1,55 +1,51 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const proxy = {
|
const proxy = process.env.VUE_APP_API || "http://192.168.1.87:9000"
|
||||||
// dv: "https://pingchangdjweb.icunwei.com/",
|
|
||||||
dv: "http://192.168.1.87:9000",
|
|
||||||
fengdu: "https://web.fdfengshou.cn/"
|
|
||||||
}[process.env.VUE_APP_SCOPE] || "http://192.168.1.87:9000"
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
lintOnSave: false,
|
lintOnSave: false,
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
css: {
|
css: {
|
||||||
loaderOptions: {
|
loaderOptions: {
|
||||||
scss: {
|
scss: {
|
||||||
data: `@import "~dui/lib/styles/vars.scss";`
|
data: `@import "~dui/lib/styles/vars.scss";`
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
//多页面配置
|
|
||||||
pages: {
|
|
||||||
index: {
|
|
||||||
entry: 'examples/main.js',
|
|
||||||
template: 'public/index.html',
|
|
||||||
filename: 'index.html'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
transpileDependencies: [/dui[\\\/]lib[\\\/]js/, /manifest.js/],
|
|
||||||
chainWebpack: (config) => {
|
|
||||||
config.module
|
|
||||||
.rule('js')
|
|
||||||
.include
|
|
||||||
.add(path.resolve(__dirname, 'packages'))
|
|
||||||
.add(path.resolve(__dirname, 'components'))
|
|
||||||
.add(path.resolve(__dirname, 'project'))
|
|
||||||
.add(path.resolve(__dirname, 'examples'))
|
|
||||||
.add(path.resolve(__dirname, 'ui'))
|
|
||||||
.end().use('babel').loader('babel-loader').tap(options => options);
|
|
||||||
config.plugin("limit").use(require("webpack/lib/optimize/LimitChunkCountPlugin"), [{maxChunks: 10}]).tap(options => options)
|
|
||||||
},
|
|
||||||
devServer: {
|
|
||||||
host: '0.0.0.0', //主机地址
|
|
||||||
port: 80, //端口号
|
|
||||||
open: true,
|
|
||||||
proxy: {
|
|
||||||
//设置代理,可解决跨
|
|
||||||
'/lan': {
|
|
||||||
target: proxy,
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: {
|
|
||||||
//地址重写
|
|
||||||
'^/lan': '/'
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
disableHostCheck: true,
|
//多页面配置
|
||||||
}
|
pages: {
|
||||||
|
index: {
|
||||||
|
entry: 'examples/main.js',
|
||||||
|
template: 'public/index.html',
|
||||||
|
filename: 'index.html'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
transpileDependencies: [/dui[\\\/]lib[\\\/]js/, /manifest.js/],
|
||||||
|
chainWebpack: (config) => {
|
||||||
|
config.module
|
||||||
|
.rule('js')
|
||||||
|
.include
|
||||||
|
.add(path.resolve(__dirname, 'packages'))
|
||||||
|
.add(path.resolve(__dirname, 'components'))
|
||||||
|
.add(path.resolve(__dirname, 'project'))
|
||||||
|
.add(path.resolve(__dirname, 'examples'))
|
||||||
|
.add(path.resolve(__dirname, 'ui'))
|
||||||
|
.end().use('babel').loader('babel-loader').tap(options => options);
|
||||||
|
config.plugin("limit").use(require("webpack/lib/optimize/LimitChunkCountPlugin"), [{maxChunks: 10}]).tap(options => options)
|
||||||
|
},
|
||||||
|
devServer: {
|
||||||
|
host: '0.0.0.0', //主机地址
|
||||||
|
port: 7000, //端口号
|
||||||
|
open: true,
|
||||||
|
proxy: {
|
||||||
|
//设置代理,可解决跨
|
||||||
|
'/lan': {
|
||||||
|
target: proxy,
|
||||||
|
changeOrigin: true,
|
||||||
|
pathRewrite: {
|
||||||
|
//地址重写
|
||||||
|
'^/lan': '/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
disableHostCheck: true,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user