Skip to content
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

restore support for extending babel configuration #817

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/plugin-babel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export default {
}
```

Create a _babel.config.js_ in the root of your project with your own custom plugins / settings that you've installed and want to use.
Create a _babel.config.cjs_ in the root of your project with your own custom plugins / settings that you've installed and want to use.

```javascript
export default {
module.exports = {
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-methods'
Expand All @@ -45,6 +45,8 @@ export default {

This will then process your JavaScript with Babel with the configurated plugins / settings you provide.

> _For now Babel configuration needs to be in CJS. Will we be adding ESM support soon!_

## Options
This plugin provides a default _babel.config.js_ that includes support for [**@babel/preset-env**](https://babeljs.io/docs/en/babel-preset-env) using [**browserslist**](https://github.com/browserslist/browserslist) with reasonable [default configs](https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-babel/src/) for each.

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-babel/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const greenwoodPluginBabel = (options = {}) => {
provider: (compilation) => [
rollupBabelPlugin.default({
// https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
babelHelpers: options.extendConfig ? 'runtime' : 'bundled',
babelHelpers: 'bundled',

...getConfig(compilation, options.extendConfig)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { fileURLToPath, URL } from 'url';

const expect = chai.expect;

xdescribe('Build Greenwood With: ', function() {
describe('Build Greenwood With: ', function() {
const LABEL = 'Custom Babel Options for extending Default Configuration';
const cliPath = path.join(process.cwd(), 'packages/cli/src/index.js');
const outputPath = fileURLToPath(new URL('.', import.meta.url));
Expand Down