Authored by QC-L

添加构建命令可实现开发环境切换线上数据 review by 黄敬囿

const NODE_ENV = process.env.NODE_ENV;
module.exports = {
env: {
NODE_ENV: '"development"'
NODE_ENV: NODE_ENV ? NODE_ENV: '"development"'
},
defineConstants: {
},
... ...
const NODE_ENV = process.env.NODE_ENV;
module.exports = {
env: {
NODE_ENV: '"production"'
NODE_ENV: NODE_ENV ? NODE_ENV: '"production"'
},
defineConstants: {
},
... ...
... ... @@ -6,8 +6,11 @@
"main": "index.js",
"scripts": {
"build:weapp": "taro build --type weapp",
"build:dev-weapp": "taro build --type weapp --env development",
"build:pro-weapp": "taro build --type weapp --env production",
"build:h5": "taro build --type h5",
"dev:weapp": "npm run build:weapp -- --watch",
"dev:pro-weapp": "npm run build:pro-weapp -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
... ...
... ... @@ -71,7 +71,7 @@ class App extends Component {
iconPath: './static/images/tab-icon-02.png',
selectedIconPath: './static/images/tab-icon-02-focus.png'
}, {
pagePath: 'pages/message/message/message',
pagePath: 'pages/message/message/message',
text: '消息',
iconPath: './static/images/tab-icon-03.png',
selectedIconPath: './static/images/tab-icon-03-focus.png'
... ...