babel-engine-plugin icon indicating copy to clipboard operation
babel-engine-plugin copied to clipboard

Good defaults

Open SamVerschueren opened this issue 7 years ago • 5 comments

Currently the user has to add babel-preset-env every single time. Should we bake this in and provide good defaults? I think it's always good to have good defaults.

SamVerschueren avatar Apr 04 '17 15:04 SamVerschueren

What if it uses the .babelrc of each module, if present?

The downside is that the consumer needs to install every babel plugin or preset, and versions may not match.

skyrpex avatar Jun 07 '17 10:06 skyrpex

.babelrcs and package.json etc should be honoured I think.

stevemao avatar Jun 29 '17 05:06 stevemao

@stevemao from the root project you mean right?

SamVerschueren avatar Jun 29 '17 06:06 SamVerschueren

Babel will look for a .babelrc in the current directory of the file being transpiled. If one does not exist, it will travel up the directory tree until it finds either a .babelrc, or a package.json with a "babel": {} hash within. Use "babelrc": false in options to stop lookup behavior, or provide the --no-babelrc CLI flag.

Looks like package.json should live in the root. But I'm not sure. As long as this plugin behaves the same as the conventional way :)

https://babeljs.io/docs/usage/babelrc/#lookup-behavior

stevemao avatar Jun 29 '17 06:06 stevemao

Running new BabelEnginePlugin() currently uses the .babelrc file, if present - which works for us, I think.

thasmo avatar Feb 14 '18 16:02 thasmo