2022-09-27 17:59:05 +08:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
webpack: function (config, env) {
|
2022-10-19 12:35:09 +08:00
|
|
|
if (env === 'production') {
|
|
|
|
config.output.publicPath = process.env.REACT_APP_PUBLIC_PATH;
|
2022-09-27 17:59:05 +08:00
|
|
|
}
|
|
|
|
config.resolve.alias = {
|
|
|
|
...config.resolve.alias,
|
|
|
|
'@': path.resolve(__dirname, 'src'),
|
|
|
|
};
|
|
|
|
|
|
|
|
return config;
|
|
|
|
},
|
|
|
|
|
|
|
|
devServer: function (configFunction) {
|
|
|
|
return function (proxy, allowedHost) {
|
|
|
|
const config = configFunction(proxy, allowedHost);
|
|
|
|
config.proxy = {
|
|
|
|
'/answer': {
|
2022-10-28 20:01:00 +08:00
|
|
|
target: 'http://10.0.10.98:2060',
|
2022-09-27 17:59:05 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
secure: false,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
return config;
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|