-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taro开发过程中压缩代码 #4645
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
试一下 |
谢谢,我设置了env现在可以了 https://nervjs.github.io/taro/docs/config-detail.html#env |
具体是怎么设置的呢?可以给个代码截图吗 |
taro build 命令的输出就有具体设置的代码,仔细看看 |
问题描述
目的:开发包太大无法预览,想在开发的时候利用taro压缩功能.
已知taro开发时候压缩代码的命令是 NODE_ENV=production taro build --type weapp --watch,为了方便我本地判断process.env.NODE_ENV===production时打包正式服务器版本,否则打包预发布(开发)版本,但是为了压缩代码必须设置NODE_ENV=production,所以我该如何使用taro设置一个环境变量判断当前为开发环境或正式环境.
复现步骤
期望行为
传递参数获取process
报错信息
系统信息
Taro CLI 1.3.20 environment info:
System:
OS: macOS 10.15
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
Yarn: 1.19.1 - ~/.nvm/versions/node/v10.16.3/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
npmPackages:
@tarojs/async-await: 1.3.20 => 1.3.20
@tarojs/cli: 1.3.20 => 1.3.20
@tarojs/components: 1.3.20 => 1.3.20
@tarojs/plugin-babel: 1.3.20 => 1.3.20
@tarojs/plugin-csso: 1.3.20 => 1.3.20
@tarojs/plugin-less: 1.3.20 => 1.3.20
@tarojs/plugin-uglifyjs: 1.3.20 => 1.3.20
@tarojs/redux: 1.3.20 => 1.3.20
@tarojs/redux-h5: 1.3.20 => 1.3.20
@tarojs/rn-runner: 1.3.20 => 1.3.20
@tarojs/router: 1.3.20 => 1.3.20
@tarojs/taro: 1.3.20 => 1.3.20
@tarojs/taro-h5: 1.3.20 => 1.3.20
@tarojs/taro-weapp: 1.3.20 => 1.3.20
@tarojs/webpack-runner: 1.3.20 => 1.3.20
eslint-config-taro: 1.3.20 => 1.3.20
eslint-plugin-taro: 1.3.20 => 1.3.20
nervjs: ^1.5.1 => 1.5.1
The text was updated successfully, but these errors were encountered: