You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/babel/README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Using Rollup with `@rollup/plugin-babel` makes the process far easier.
26
26
27
27
## Requirements
28
28
29
-
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v10.0.0+) and Rollup v1.20.0+.
29
+
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+.
30
30
31
31
## Install
32
32
@@ -45,7 +45,7 @@ const config = {
45
45
input:'src/index.js',
46
46
output: {
47
47
dir:'output',
48
-
format:'esm'
48
+
format:'es'
49
49
},
50
50
plugins: [babel({ babelHelpers:'bundled' })]
51
51
};
@@ -174,7 +174,7 @@ export default {
174
174
],
175
175
output: [
176
176
{ file:'bundle.cjs.js', format:'cjs' },
177
-
{ file:'bundle.esm.js', format:'esm' }
177
+
{ file:'bundle.es.js', format:'es' }
178
178
]
179
179
};
180
180
```
@@ -188,10 +188,10 @@ import { getBabelOutputPlugin } from '@rollup/plugin-babel';
### Using formats other than ES modules or CommonJS
233
233
234
-
As `getBabelOutputPlugin(...)` will run _after_ Rollup has done all its transformations, it needs to make sure it preserves the semantics of Rollup's output format. This is especially important for Babel plugins that add, modify or remove imports or exports, but also for other transformations that add new variables as they can accidentally become global variables depending on the format. Therefore it is recommended that for formats other than `esm` or `cjs`, you set Rollup to use the `esm` output format and let Babel handle the transformation to another format, e.g. via
234
+
As `getBabelOutputPlugin(...)` will run _after_ Rollup has done all its transformations, it needs to make sure it preserves the semantics of Rollup's output format. This is especially important for Babel plugins that add, modify or remove imports or exports, but also for other transformations that add new variables as they can accidentally become global variables depending on the format. Therefore it is recommended that for formats other than `es` or `cjs`, you set Rollup to use the `es` output format and let Babel handle the transformation to another format, e.g. via
@@ -256,12 +256,12 @@ By default, helpers e.g. when transpiling classes will be inserted at the top of
256
256
257
257
Alternatively, you can use imported runtime helpers by adding the `@babel/transform-runtime` plugin. This will make `@babel/runtime` an external dependency of your project, see [@babel/plugin-transform-runtime](https://babeljs.io/docs/en/babel-plugin-transform-runtime) for details.
258
258
259
-
Note that this will only work for `esm` and `cjs` formats, and you need to make sure to set the `useESModules` option of `@babel/plugin-transform-runtime` to `true` if you create ESM output:
259
+
Note that this will only work for `es` and `cjs` formats, and you need to make sure to set the `useESModules` option of `@babel/plugin-transform-runtime` to `true` if you create ES output:
0 commit comments