diff --git a/packages/plugin-babel/README.md b/packages/plugin-babel/README.md index 92f2009be..27d68e96d 100644 --- a/packages/plugin-babel/README.md +++ b/packages/plugin-babel/README.md @@ -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' @@ -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. diff --git a/packages/plugin-babel/src/index.js b/packages/plugin-babel/src/index.js index 1a6633c30..364f9c051 100644 --- a/packages/plugin-babel/src/index.js +++ b/packages/plugin-babel/src/index.js @@ -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) }) diff --git a/packages/plugin-babel/test/cases/options.extend-config/babel.config.js b/packages/plugin-babel/test/cases/options.extend-config/babel.config.cjs similarity index 100% rename from packages/plugin-babel/test/cases/options.extend-config/babel.config.js rename to packages/plugin-babel/test/cases/options.extend-config/babel.config.cjs diff --git a/packages/plugin-babel/test/cases/options.extend-config/options.extend-config.spec.js b/packages/plugin-babel/test/cases/options.extend-config/options.extend-config.spec.js index a84312e32..daeae0685 100644 --- a/packages/plugin-babel/test/cases/options.extend-config/options.extend-config.spec.js +++ b/packages/plugin-babel/test/cases/options.extend-config/options.extend-config.spec.js @@ -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));