73 lines
1.8 KiB
JavaScript
73 lines
1.8 KiB
JavaScript
const path = require('path');
|
|
const webpack = require('webpack');
|
|
|
|
const runtimeEnvironment = process.env.VUE_APP_RUNTIME_ENV === 'production'
|
|
? 'production'
|
|
: 'local';
|
|
const appServerTarget = process.env.VUE_APP_APP_SERVER_TARGET || 'http://18.141.44.165:8888';
|
|
const webApiTarget = process.env.VUE_APP_WEB_API_TARGET || 'http://18.141.44.165:9000';
|
|
|
|
module.exports = {
|
|
outputDir: 'dist',
|
|
publicPath: './',
|
|
transpileDependencies: true,
|
|
configureWebpack: {
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
'legacy-wfc': path.resolve(__dirname, '../src/wfc'),
|
|
'legacy-config': path.resolve(__dirname, '../src/config.js')
|
|
},
|
|
fallback: {
|
|
path: false,
|
|
fs: false,
|
|
assert: false,
|
|
util: false,
|
|
os: false,
|
|
crypto: false,
|
|
buffer: require.resolve('buffer/')
|
|
}
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
process: 'process/browser',
|
|
Buffer: ['buffer', 'Buffer']
|
|
})
|
|
]
|
|
},
|
|
devServer: {
|
|
allowedHosts: 'all',
|
|
client: {
|
|
overlay: false
|
|
},
|
|
proxy: {
|
|
'/app-server': {
|
|
target: appServerTarget,
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/app-server': ''
|
|
}
|
|
},
|
|
'/local-api': {
|
|
target: webApiTarget,
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/local-api': '/api'
|
|
}
|
|
},
|
|
'/api': {
|
|
target: webApiTarget,
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
},
|
|
chainWebpack(config) {
|
|
config.plugin('html').tap((args) => {
|
|
args[0].runtimeConfigFile = `runtime-config.${runtimeEnvironment}.js`;
|
|
return args;
|
|
});
|
|
config.optimization.concatenateModules(false);
|
|
config.optimization.minimize(false);
|
|
}
|
|
};
|