-
Notifications
You must be signed in to change notification settings - Fork 441
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
webpack打包问题。 #27
Comments
bablerc里面的env配置,导致生产打包失败。 |
babelrc的"presets": ["es2015","react","stage-0", "env"],删掉‘env’就可以了。 |
作者你好,我补充了生产环境打包构建的代码,没几行,已经在本地跑过,想merge到你的项目里面,可以吗? |
好啊~你提一下pr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
修改了webpack配置,增加了一个打包配置:、
"build": "cross-env NODE_ENV=production webpack --config webpack.prod.js"
然后执行 npm run build。报错如下
ERROR in ./app/index.js
Module build failed: ReferenceError: [BABEL] D:\yp\React-Blog-Demo\app\index.js: Unknown option: D:\yp\React-Blog-Demo.babelrc.env.production.preset. Check out http://babeljs.io/docs/usage/options/ for more information about options.
# A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:
Invalid:
{ presets: [{option: value}] }
Valid:
{ presets: [['presetName', {option: value}]] }
For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.
at Logger.error (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\logger.js:41:11)
at OptionManager.mergeOptions (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\options\option-manager.js:226:20)
at OptionManager.init (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at File.initOptions (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (D:\yp\React-Blog-Demo\node_modules\babel-loader\lib\index.js:50:20)
at Object.module.exports (D:\yp\React-Blog-Demo\node_modules\babel-loader\lib\index.js:173:20)
@ multi babel-polyfill ./app/index.js
The text was updated successfully, but these errors were encountered: