Skip to content

Commit

Permalink
restore support for extending babel configuration (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 authored Dec 9, 2021
1 parent 9cf58e7 commit 7f7424e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
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

0 comments on commit 7f7424e

Please sign in to comment.