For now, if you are ignoring presets option in brunch-config file or just set it as an empty array, babel-brunch will automatically set es2015, es2016 presets. It causes conflicts if you keep your babel config in .babelrc or babel option in package.json file.
babel-brunch ignore files with jsx/es6 extensions unless it finds react preset in presets from brunch-config. Again, if you are using configuration from .baberc/package.json even with react preset, plugin won't catch it and will observe only .js files.
Proposed solution:
Make js/jsx/es6 pattern static.
Remove default presets. For now, many people can use babel-brunch without configuration with default presets and we must allow this enhancement only with config.lookupConfigs = true to prevent crashes . It would add the ability to use people babelrc and package.json configs, but must prevent other users' incomprehension.
If users are using plugin with empty babel configuration and without lookupConfigs option - warn them to add presets they need.
Warn people using ES6to5 option and to change it to babel.
So after these changes, we will protect users from crashes and at the same time add the ability to use babelrc + pckg.json configuration normally by providing lookupConfigs option.
This PR is intended to fix 2 issues:
brunch-config
file or just set it as an empty array, babel-brunch will automatically set es2015, es2016 presets. It causes conflicts if you keep your babel config in .babelrc orbabel
option in package.json file.Proposed solution:
js/jsx/es6
pattern static.config.lookupConfigs = true
to prevent crashes . It would add the ability to use people babelrc and package.json configs, but must prevent other users' incomprehension.lookupConfigs
option - warn them to add presets they need.ES6to5
option and to change it tobabel
.So after these changes, we will protect users from crashes and at the same time add the ability to use babelrc + pckg.json configuration normally by providing
lookupConfigs
option.