2022-09-27 17:59:05 +08:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
webpack: function (config, env) {
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
config.output.publicPath = process.env.CDN_PATH;
|
|
|
|
}
|
|
|
|
|
|
|
|
config.resolve.alias = {
|
|
|
|
...config.resolve.alias,
|
|
|
|
'@': path.resolve(__dirname, 'src'),
|
|
|
|
'@answer/pages': path.resolve(__dirname, 'src/pages'),
|
|
|
|
'@answer/components': path.resolve(__dirname, 'src/components'),
|
|
|
|
'@answer/stores': path.resolve(__dirname, 'src/stores'),
|
|
|
|
'@answer/hooks': path.resolve(__dirname, 'src/hooks'),
|
|
|
|
'@answer/utils': path.resolve(__dirname, 'src/utils'),
|
|
|
|
'@answer/common': path.resolve(__dirname, 'src/common'),
|
2022-09-28 18:25:30 +08:00
|
|
|
'@answer/api': path.resolve(__dirname, 'src/services/api'),
|
2022-09-27 17:59:05 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return config;
|
|
|
|
},
|
|
|
|
|
|
|
|
devServer: function (configFunction) {
|
|
|
|
return function (proxy, allowedHost) {
|
|
|
|
const config = configFunction(proxy, allowedHost);
|
|
|
|
config.proxy = {
|
|
|
|
'/answer': {
|
2022-09-29 15:05:00 +08:00
|
|
|
// target: "http://10.0.20.84:8080",
|
|
|
|
target: 'http://10.0.10.98:2060',
|
2022-09-27 17:59:05 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
secure: false,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
return config;
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|