minify: Failing build because of `yield` keyword
I have errors like these when building with babel-preset-babili
:
ERROR in ./src/redux/sagas/landing-menu.js
Module build failed: SyntaxError: The keyword 'yield' is reserved (1:2367)
at Parser.pp.raise (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1745:13)
at Parser.pp.parseIdent (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1464:240)
at Parser.pp.parseExprAtom (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1090:21)
at Parser.pp.parseExprSubscripts (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1023:19)
at Parser.pp.parseMaybeUnary (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1004:19)
at Parser.pp.parseExprOps (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:948:19)
at Parser.pp.parseMaybeConditional (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:930:19)
at Parser.pp.parseMaybeAssign (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:908:19)
at Parser.pp.parseVar (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2743:24)
at Parser.pp.parseVarStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2637:8)
at Parser.pp.parseStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2437:19)
at Parser.pp.parseBlock (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2692:21)
at Parser.pp.parseFunctionBody (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:1413:22)
at Parser.pp.parseFunction (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2770:8)
at Parser.pp.parseFunctionStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2540:15)
at Parser.pp.parseStatement (PROJECT_FOLDER/node_modules/acorn/dist/acorn.js:2420:19)
@ ./src/redux/sagas/index.js 1:285-310
My .babelrc
:
{
"presets": [ "es2015", "stage-1", "react" ],
"plugins": [
"transform-runtime",
"transform-decorators-legacy"
],
"env": {
"production": {
"presets": ["babili"],
"plugins": [
"transform-react-inline-elements",
"transform-react-constant-elements"
]
}
}
}
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (7 by maintainers)
We just need to release an update ASAP, since
passPerPreset = false
is really too troublesome.