-
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
设置 defineConstants 后,build:h5 报错:Unexpected token num «0.4», expected punc «,» #1774
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
CC @Littly |
有没有编译报错之类 |
chunk/about_about.js from UglifyJs
Unexpected token num «0.4», expected punc «,» [chunk/about_about.js:184,15] 但是我 about.js 里面并没有 0.4 的字样。 最终显示: Done in 14.88s.
Process finished with exit code 0 |
经测试,不是版本的问题,是设置了 新的复现步骤
defineConstants: {
'version': process.env.npm_package_version
}
补充信息 |
defineConstants: {
'version': JSON.stringify(process.env.npm_package_version)
} 这样试试 |
可以了,非常感谢,原来是我自己疏忽了,没转成 |
问题描述
更新到 1.2.3 后,build:h5 只生成 lib 文件夹,没有其它内容,印象中好像 1.2.2 也会,其它版本没试过
复现步骤
config/index.js
中配置:npm run build:h5
期望行为
编译不报错
报错信息
命令行报错:
系统信息
👽 Taro v1.2.3
Taro CLI 1.2.3 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.12.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
补充信息
经测试,在注释掉
defineConstants
中的内容,或者注释掉version
中的引用时编译成功,且编译成小程序正常无报错,只在h5
下有问题。The text was updated successfully, but these errors were encountered: