优化环境域名切换
This commit is contained in:
parent
19c266ed4f
commit
9af19370ac
@ -1,9 +1,10 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"development"'
|
NODE_ENV: '"development"',
|
||||||
},
|
},
|
||||||
defineConstants: {
|
defineConstants: {
|
||||||
|
CURRENT_BASE_URL: '"https://test.zzfzyc.com/lymarket"',
|
||||||
},
|
},
|
||||||
mini: {
|
mini: {
|
||||||
// optimizeMainPackage: {
|
// optimizeMainPackage: {
|
||||||
@ -14,7 +15,8 @@ module.exports = {
|
|||||||
plugin: {
|
plugin: {
|
||||||
install: {
|
install: {
|
||||||
plugin: require('terser-webpack-plugin'),
|
plugin: require('terser-webpack-plugin'),
|
||||||
args: [{
|
args: [
|
||||||
|
{
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
compress: true, // 默认使用terser压缩
|
compress: true, // 默认使用terser压缩
|
||||||
// compress: {
|
// compress: {
|
||||||
@ -22,20 +24,21 @@ module.exports = {
|
|||||||
// }, // 默认使用terser压缩
|
// }, // 默认使用terser压缩
|
||||||
// mangle: false,
|
// mangle: false,
|
||||||
keep_classnames: true, // 不改变class名称
|
keep_classnames: true, // 不改变class名称
|
||||||
keep_fnames: true // 不改变函数名称
|
keep_fnames: true, // 不改变函数名称
|
||||||
}
|
},
|
||||||
}]
|
},
|
||||||
}
|
],
|
||||||
}
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
h5: {},
|
h5: {},
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, '..', 'src'),
|
'@': path.resolve(__dirname, '..', 'src'),
|
||||||
},
|
},
|
||||||
sass: {
|
sass: {
|
||||||
resource: path.resolve(__dirname, '..', 'src/styles/common.scss')
|
resource: path.resolve(__dirname, '..', 'src/styles/common.scss'),
|
||||||
},
|
},
|
||||||
// plugins: [
|
// plugins: [
|
||||||
// '@tarojs/plugin-react-devtools'
|
// '@tarojs/plugin-react-devtools'
|
||||||
|
@ -3,7 +3,9 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"pre"',
|
NODE_ENV: '"pre"',
|
||||||
},
|
},
|
||||||
defineConstants: {},
|
defineConstants: {
|
||||||
|
CURRENT_BASE_URL: '"https://pre.zzfzyc.com/lymarket"',
|
||||||
|
},
|
||||||
mini: {
|
mini: {
|
||||||
optimizeMainPackage: {
|
optimizeMainPackage: {
|
||||||
enable: true,
|
enable: true,
|
||||||
|
@ -3,7 +3,9 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
},
|
},
|
||||||
defineConstants: {},
|
defineConstants: {
|
||||||
|
CURRENT_BASE_URL: '"https://www.zzfzyc.com/lymarket"',
|
||||||
|
},
|
||||||
mini: {
|
mini: {
|
||||||
optimizeMainPackage: {
|
optimizeMainPackage: {
|
||||||
enable: true,
|
enable: true,
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
"dev:qq": "npm run build:qq -- --watch",
|
"dev:qq": "npm run build:qq -- --watch",
|
||||||
"dev:jd": "npm run build:jd -- --watch",
|
"dev:jd": "npm run build:jd -- --watch",
|
||||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||||
"build:weapp:pre": "cross-env NODE_ENV=pre taro build --type weapp"
|
"build:weapp:pre": "cross-env NODE_ENV=pre taro build --type weapp",
|
||||||
|
"dev:weapp:pre": "cross-env NODE_ENV=pre npm run build:weapp -- --watch"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 3 versions",
|
"last 3 versions",
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
function BASE_URL_LIST() {
|
export const BASE_URL = CURRENT_BASE_URL
|
||||||
return {
|
|
||||||
development: `https://test.zzfzyc.com/lymarket`,
|
|
||||||
production: `https://www.zzfzyc.com/lymarket`,
|
|
||||||
pre: `https://pre.zzfzyc.com/lymarket`,
|
|
||||||
}[process.env.NODE_ENV || 'production']
|
|
||||||
}
|
|
||||||
|
|
||||||
export const BASE_URL = BASE_URL_LIST()
|
|
||||||
// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
|
// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
|
||||||
// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
|
// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
|
||||||
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
|
||||||
@ -29,12 +21,10 @@ export const GET_UPLOAD_SIGN = `/upyun/getsign` // 请求签名 url
|
|||||||
export const UPLOAD_CDN_URL = `https://v0.api.upyun.com/`
|
export const UPLOAD_CDN_URL = `https://v0.api.upyun.com/`
|
||||||
|
|
||||||
// cdn
|
// cdn
|
||||||
export const IMG_CND_Prefix = CURRENT_ENV.includes('development') ? 'https://test.cdn.zzfzyc.com' : 'https://cdn.zzfzyc.com'
|
export const IMG_CND_Prefix = CURRENT_ENV.includes('production') ? 'https://cdn.zzfzyc.com' : 'https://test.cdn.zzfzyc.com'
|
||||||
// export const IMG_CND_Prefix = CURRENT_ENV.includes('development') ? 'https://test.cdn.zzfzyc.com' : 'https://www.cdn.zzfzyc.com'
|
|
||||||
|
|
||||||
//在线支付图片baseUrl
|
//在线支付图片baseUrl
|
||||||
export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development') ? 'https://test.zzfzyc.com' : 'https://www.zzfzyc.com'
|
export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('production') ? 'https://www.zzfzyc.com' : 'https://test.zzfzyc.com'
|
||||||
// export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development') ? 'https://test.zzfzyc.com' : 'https://www.zzfzyc.com'
|
|
||||||
|
|
||||||
// 上传图片视频
|
// 上传图片视频
|
||||||
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
|
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user