2023-07-29 18:34:02 +08:00
|
|
|
|
// 不能用localhost,https://forum.dfinity.org/t/development-workflow-quickly-test-code-modifications/1793/21
|
|
|
|
|
const API_BASE_URL = 'http://127.0.0.1:12450'
|
2022-02-27 22:05:37 +08:00
|
|
|
|
|
2022-01-07 23:18:34 +08:00
|
|
|
|
module.exports = {
|
2022-02-27 22:05:37 +08:00
|
|
|
|
devServer: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
|
|
|
|
target: API_BASE_URL,
|
|
|
|
|
ws: true
|
|
|
|
|
},
|
2022-03-01 22:13:25 +08:00
|
|
|
|
'/emoticons': {
|
2022-02-27 22:05:37 +08:00
|
|
|
|
target: API_BASE_URL
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-01-07 23:18:34 +08:00
|
|
|
|
chainWebpack: config => {
|
2022-02-23 23:15:21 +08:00
|
|
|
|
const APP_VERSION = `v${process.env.npm_package_version}`
|
2022-01-07 23:18:34 +08:00
|
|
|
|
|
|
|
|
|
config.plugin('define')
|
|
|
|
|
.tap(args => {
|
|
|
|
|
let defineMap = args[0]
|
|
|
|
|
let env = defineMap['process.env']
|
|
|
|
|
env['APP_VERSION'] = JSON.stringify(APP_VERSION)
|
|
|
|
|
return args
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|