babel / babel-brunch

Brunch plugin for Babel
ISC License
68 stars 38 forks source link

Fix bugs when using .babelrc, and babel option in package.json #48

Closed yavorsky closed 7 years ago

yavorsky commented 7 years ago

This PR is intended to fix 2 issues:

  1. 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.
  2. 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:

  1. Make js/jsx/es6 pattern static.
  2. 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.
  3. If users are using plugin with empty babel configuration and without lookupConfigs option - warn them to add presets they need.
  4. 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.

shvaikalesh commented 7 years ago

I believe this was superseded by https://github.com/babel/babel-brunch/pull/49