7.37.0 • Published 13 days ago

@wordpress/babel-preset-default v7.37.0

Weekly downloads
19,797
License
GPL-2.0-or-later
Repository
github
Last release
13 days ago

Babel Preset Default

Default Babel preset for WordPress development.

The preset includes configuration which enable language features and syntax extensions targeted for support by WordPress. This includes ECMAScript proposals which have reached Stage 4 ("Finished"), as well as the JSX syntax extension. For more information, refer to the JavaScript Coding Guidelines.

Installation

Install the module

npm install @wordpress/babel-preset-default --save-dev

Note: This package requires Node.js 14.0.0 or later. It is not compatible with older versions.

Usage

There are a number of methods to configure Babel. See Babel's Configuration documentation for more information. To use this preset, simply reference @wordpress/babel-preset-default in the presets option in your Babel configuration.

For example, using .babelrc:

{
	"presets": [ "@wordpress/babel-preset-default" ]
}

Extending Configuration

This preset is an opinionated configuration. If you would like to add to or change this configuration, you can do so by expanding your Babel configuration to include plugins or presets which override those included through this preset. It may help to familiarize yourself the implementation of the configuration to see which specific plugins are enabled by default through this preset.

For example, if you'd like to use a new language feature proposal which has not reached the stability requirements of WordPress, you can add those as additional plugins in your Babel configuration:

{
	"presets": [ "@wordpress/babel-preset-default" ],
	"plugins": [ "@babel/plugin-proposal-class-properties" ]
}

Polyfill

There is a complementary build/polyfill.js (minified version – build/polyfill.min.js) file available that polyfills ECMAScript features missing in the browsers supported by the WordPress project (#31279). It's a drop-in replacement for the deprecated @babel/polyfill package, and it's also based on core-js project.

This needs to be included before all your compiled Babel code. You can either prepend it to your compiled code or include it in a <script> before it.

TC39 Proposals

If you need to use a proposal that is not Stage 4, this polyfill will not automatically import those for you. You will have to import those from another polyfill like core-js individually.

Contributing to this package

This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to npm and used by WordPress as well as other software projects.

To find out more about contributing to this package or Gutenberg as a whole, please read the project's main contributor guide.

7.37.0

13 days ago

7.36.0

26 days ago

7.35.1

28 days ago

7.35.0

1 month ago

7.34.0

2 months ago

7.33.0

2 months ago

7.32.0

3 months ago

7.25.0

7 months ago

7.21.0

9 months ago

7.29.0

5 months ago

7.24.1

7 months ago

7.28.0

5 months ago

7.24.0

7 months ago

7.31.0

4 months ago

7.27.0

6 months ago

7.23.0

7 months ago

7.26.10

5 months ago

7.26.11

5 months ago

7.26.12

4 months ago

7.26.13

4 months ago

7.30.0

4 months ago

7.19.2

5 months ago

7.26.0

6 months ago

7.26.2

6 months ago

7.26.1

6 months ago

7.22.0

8 months ago

7.26.8

5 months ago

7.26.7

5 months ago

7.26.9

5 months ago

7.26.4

5 months ago

7.26.3

6 months ago

7.26.6

5 months ago

7.26.5

5 months ago

7.10.3

5 months ago

7.18.0

10 months ago

7.17.0

10 months ago

7.20.0

9 months ago

7.19.1

9 months ago

7.19.0

10 months ago

7.13.0

1 year ago

7.16.0

11 months ago

7.12.0

1 year ago

7.15.0

11 months ago

7.14.0

12 months ago

6.17.0

2 years ago

7.3.0

1 year ago

7.8.0

1 year ago

6.13.0

2 years ago

6.6.1

2 years ago

6.6.0

2 years ago

7.0.0

2 years ago

7.4.0

1 year ago

6.12.0

2 years ago

7.5.0

1 year ago

6.16.0

2 years ago

7.9.0

1 year ago

6.7.0

2 years ago

7.1.1

1 year ago

7.1.0

2 years ago

6.11.0

2 years ago

7.6.0

1 year ago

6.15.0

2 years ago

6.8.1

2 years ago

6.8.0

2 years ago

7.11.0

1 year ago

7.2.0

1 year ago

7.7.0

1 year ago

6.10.0

2 years ago

6.14.0

2 years ago

6.9.0

2 years ago

7.10.2

1 year ago

7.10.0

1 year ago

7.10.1

1 year ago

6.5.0

2 years ago

6.4.1

2 years ago

6.4.0

2 years ago

6.3.4

2 years ago

6.5.1

2 years ago

6.3.3

2 years ago

6.3.2

3 years ago

6.2.1

3 years ago

6.3.1

3 years ago

6.3.0

3 years ago

6.2.0

3 years ago

6.1.0

3 years ago

5.2.2

3 years ago

6.0.0

3 years ago

5.2.1

3 years ago

5.2.0

3 years ago

5.1.0

3 years ago

5.0.0-next.1

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

5.0.0-next.0

3 years ago

4.20.0

3 years ago

4.19.0

3 years ago

4.18.1

4 years ago

4.18.0

4 years ago

4.17.0

4 years ago

4.16.0

4 years ago

4.15.1-rc.0

4 years ago

4.15.0

4 years ago

4.14.0

4 years ago

4.13.0

4 years ago

4.12.1

4 years ago

4.12.0

4 years ago

4.11.0

4 years ago

4.10.0

4 years ago

4.9.0

4 years ago

4.8.0

4 years ago

4.7.0

4 years ago

4.6.2

4 years ago

4.6.1

4 years ago

4.6.0

5 years ago

4.5.0

5 years ago

4.4.0

5 years ago

4.3.0

5 years ago

4.2.0

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

1.0.1-0

6 years ago