@rollup/plugin-babel 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ # @rollup/plugin-babel ChangeLog
2
+
3
+ ## v5.0.2
4
+
5
+ _2020-05-20_
6
+
7
+ ### Bugfixes
8
+
9
+ - fix: use loadPartialConfigAsync when it is available (#359)
10
+
11
+ ### Updates
12
+
13
+ - docs: Cleanup misleading leftovers in the README (#377)
14
+ - docs: correct breaking change note in v5 CHANGELOG (#368)
15
+
16
+ ## v5.0.1
17
+
18
+ _2020-05-20_
19
+
20
+ ### Bugfixes
21
+
22
+ - fix: use loadPartialConfigAsync when it is available (#359)
23
+
24
+ ### Updates
25
+
26
+ - docs: Cleanup misleading leftovers in the README (#377)
27
+ - docs: correct breaking change note in v5 CHANGELOG (#368)
28
+
1
29
  # @rollup/plugin-babel changelog
2
30
 
3
31
  ## 5.0.0
@@ -19,7 +47,7 @@ _2020-04-27_
19
47
  - Minimum compatible Rollup version is 1.2.0
20
48
  - Minimum supported Node version is 10.0.0
21
49
  - `.custom` factory is now available as separate `createBabelInputPluginFactory` export
22
- - Removed `externalHelpers` & `externalHelpers` options. There is now a single `babelHelpers` option which can take one of `'bundled'`, `'inline'`, `'runtime'` and `'external'` as a value. The default is `'bundled'` which matches 4.x behavior, but it is recommended to configure this option explicitly.
50
+ - Removed `externalHelpers` & `runtimeHelpers` options. There is now a single `babelHelpers` option which can take one of `'bundled'`, `'inline'`, `'runtime'` and `'external'` as a value. The default is `'bundled'` which matches 4.x behavior, but it is recommended to configure this option explicitly.
23
51
 
24
52
  ## 4.3.2
25
53
 
package/README.md CHANGED
@@ -60,7 +60,7 @@ Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#comma
60
60
 
61
61
  This plugin respects Babel [configuration files](https://babeljs.io/docs/en/configuration) by default and they are generally the best place to put your configuration.
62
62
 
63
- You can also run Babel on the generated chunks instead of the input files. Even though this is slower, it is the only way to transpile Rollup's auto-generated wrapper code to lower compatibility targets than ES5 (or most likely ES6 when Rollup 2 will be released), see [Running Babel on the generated code](#running-babel-on-the-generated-code) for details.
63
+ You can also run Babel on the generated chunks instead of the input files. Even though this is slower, it is the only way to transpile Rollup's auto-generated wrapper code to lower compatibility targets than ES5, see [Running Babel on the generated code](#running-babel-on-the-generated-code) for details.
64
64
 
65
65
  All options are as per the [Babel documentation](https://babeljs.io/docs/en/options), plus the following:
66
66
 
@@ -106,7 +106,7 @@ Before transpiling your input files this plugin also transpile a short piece of
106
106
 
107
107
  ### External dependencies
108
108
 
109
- Ideally, you should only be transforming your source code, rather than running all of your external dependencies through Babel – hence the `exclude: 'node_modules/**'` in the example above. If you have a dependency that exposes untranspiled ES6 source code that doesn't run in your target environment, then you may need to break this rule, but it often causes problems with unusual `.babelrc` files or mismatched versions of Babel.
109
+ Ideally, you should only be transforming your source code, rather than running all of your external dependencies through Babel (to ignore external dependencies from being handled by this plugin you might use `exclude: 'node_modules/**'` option). If you have a dependency that exposes untranspiled ES6 source code that doesn't run in your target environment, then you may need to break this rule, but it often causes problems with unusual `.babelrc` files or mismatched versions of Babel.
110
110
 
111
111
  We encourage library authors not to distribute code that uses untranspiled ES6 features (other than modules) for this reason. Consumers of your library should _not_ have to transpile your ES6 code, any more than they should have to transpile your CoffeeScript, ClojureScript or TypeScript.
112
112
 
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as babel from '@babel/core';
2
- import { transformAsync, loadPartialConfig, buildExternalHelpers, DEFAULT_EXTENSIONS } from '@babel/core';
2
+ import { transformAsync, loadPartialConfigAsync, loadPartialConfig, buildExternalHelpers, DEFAULT_EXTENSIONS } from '@babel/core';
3
3
  import { createFilter } from '@rollup/pluginutils';
4
4
  import { addNamed } from '@babel/helper-module-imports';
5
5
 
@@ -192,7 +192,8 @@ async function preflightCheck(ctx, babelHelpers, transformOptions) {
192
192
  }
193
193
 
194
194
  async function transformCode(inputCode, babelOptions, overrides, customOptions, ctx, finalizeOptions) {
195
- const config = loadPartialConfig(babelOptions); // file is ignored by babel
195
+ // loadPartialConfigAsync has become available in @babel/core@7.8.0
196
+ const config = await (loadPartialConfigAsync || loadPartialConfig)(babelOptions); // file is ignored by babel
196
197
 
197
198
  if (!config) {
198
199
  return null;
package/dist/index.js CHANGED
@@ -195,7 +195,8 @@ async function preflightCheck(ctx, babelHelpers, transformOptions) {
195
195
  }
196
196
 
197
197
  async function transformCode(inputCode, babelOptions, overrides, customOptions, ctx, finalizeOptions) {
198
- const config = babel.loadPartialConfig(babelOptions); // file is ignored by babel
198
+ // loadPartialConfigAsync has become available in @babel/core@7.8.0
199
+ const config = await (babel.loadPartialConfigAsync || babel.loadPartialConfig)(babelOptions); // file is ignored by babel
199
200
 
200
201
  if (!config) {
201
202
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollup/plugin-babel",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },