@rollup/plugin-babel
Advanced tools
Comparing version 5.3.0 to 5.3.1
# @rollup/plugin-babel ChangeLog | ||
## v5.3.1 | ||
_2022-02-22_ | ||
### Bugfixes | ||
- fix: consider path delimeter on windows (#1090) | ||
## v5.3.0 | ||
@@ -4,0 +12,0 @@ |
import * as babel from '@babel/core'; | ||
import { transformAsync, loadPartialConfigAsync, loadPartialConfig, buildExternalHelpers, DEFAULT_EXTENSIONS } from '@babel/core'; | ||
import { createFilter } from '@rollup/pluginutils'; | ||
@@ -163,8 +162,9 @@ import { addNamed } from '@babel/helper-module-imports'; | ||
const mismatchError = (actual, expected, filename) => `You have declared using "${expected}" babelHelpers, but transforming ${filename} resulted in "${actual}". Please check your configuration.`; | ||
const mismatchError = (actual, expected, filename) => `You have declared using "${expected}" babelHelpers, but transforming ${filename} resulted in "${actual}". Please check your configuration.`; // Revert to /\/helpers\/(esm\/)?inherits/ when Babel 8 gets released, this was fixed in https://github.com/babel/babel/issues/14185 | ||
const inheritsHelperRe = /\/helpers\/(esm\/)?inherits/; | ||
const inheritsHelperRe = /[\\/]+helpers[\\/]+(esm[\\/]+)?inherits/; | ||
async function preflightCheck(ctx, babelHelpers, transformOptions) { | ||
const finalOptions = addBabelPlugin(transformOptions, helpersTestTransform); | ||
const check = (await transformAsync(PREFLIGHT_INPUT, finalOptions)).code; // Babel sometimes splits ExportDefaultDeclaration into 2 statements, so we also check for ExportNamedDeclaration | ||
const check = (await babel.transformAsync(PREFLIGHT_INPUT, finalOptions)).code; // Babel sometimes splits ExportDefaultDeclaration into 2 statements, so we also check for ExportNamedDeclaration | ||
@@ -209,3 +209,3 @@ if (!/export (d|{)/.test(check)) { | ||
// loadPartialConfigAsync has become available in @babel/core@7.8.0 | ||
const config = await (loadPartialConfigAsync || loadPartialConfig)(babelOptions); // file is ignored by babel | ||
const config = await (babel.loadPartialConfigAsync || babel.loadPartialConfig)(babelOptions); // file is ignored by babel | ||
@@ -229,3 +229,3 @@ if (!config) { | ||
map | ||
} = await transformAsync(inputCode, transformOptions); | ||
} = await babel.transformAsync(inputCode, transformOptions); | ||
return { | ||
@@ -237,3 +237,3 @@ code, | ||
const result = await transformAsync(inputCode, transformOptions); | ||
const result = await babel.transformAsync(inputCode, transformOptions); | ||
const { | ||
@@ -256,3 +256,3 @@ code, | ||
let { | ||
extensions = DEFAULT_EXTENSIONS, | ||
extensions = babel.DEFAULT_EXTENSIONS, | ||
// rollup uses sourcemap, babel uses sourceMaps | ||
@@ -410,3 +410,3 @@ // just normalize them here so people don't have to worry about it | ||
return buildExternalHelpers(null, 'module'); | ||
return babel.buildExternalHelpers(null, 'module'); | ||
}, | ||
@@ -494,3 +494,2 @@ | ||
export default getBabelInputPlugin; | ||
export { getBabelInputPlugin as babel, createBabelInputPluginFactory, createBabelOutputPluginFactory, getBabelInputPlugin, getBabelOutputPlugin }; | ||
export { getBabelInputPlugin as babel, createBabelInputPluginFactory, createBabelOutputPluginFactory, getBabelInputPlugin as default, getBabelInputPlugin, getBabelOutputPlugin }; |
@@ -18,5 +18,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -26,3 +24,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -190,8 +188,9 @@ } | ||
const mismatchError = (actual, expected, filename) => `You have declared using "${expected}" babelHelpers, but transforming ${filename} resulted in "${actual}". Please check your configuration.`; | ||
const mismatchError = (actual, expected, filename) => `You have declared using "${expected}" babelHelpers, but transforming ${filename} resulted in "${actual}". Please check your configuration.`; // Revert to /\/helpers\/(esm\/)?inherits/ when Babel 8 gets released, this was fixed in https://github.com/babel/babel/issues/14185 | ||
const inheritsHelperRe = /\/helpers\/(esm\/)?inherits/; | ||
const inheritsHelperRe = /[\\/]+helpers[\\/]+(esm[\\/]+)?inherits/; | ||
async function preflightCheck(ctx, babelHelpers, transformOptions) { | ||
const finalOptions = addBabelPlugin(transformOptions, helpersTestTransform); | ||
const check = (await babel.transformAsync(PREFLIGHT_INPUT, finalOptions)).code; // Babel sometimes splits ExportDefaultDeclaration into 2 statements, so we also check for ExportNamedDeclaration | ||
const check = (await babel__namespace.transformAsync(PREFLIGHT_INPUT, finalOptions)).code; // Babel sometimes splits ExportDefaultDeclaration into 2 statements, so we also check for ExportNamedDeclaration | ||
@@ -236,3 +235,3 @@ if (!/export (d|{)/.test(check)) { | ||
// loadPartialConfigAsync has become available in @babel/core@7.8.0 | ||
const config = await (babel.loadPartialConfigAsync || babel.loadPartialConfig)(babelOptions); // file is ignored by babel | ||
const config = await (babel__namespace.loadPartialConfigAsync || babel__namespace.loadPartialConfig)(babelOptions); // file is ignored by babel | ||
@@ -256,3 +255,3 @@ if (!config) { | ||
map | ||
} = await babel.transformAsync(inputCode, transformOptions); | ||
} = await babel__namespace.transformAsync(inputCode, transformOptions); | ||
return { | ||
@@ -264,3 +263,3 @@ code, | ||
const result = await babel.transformAsync(inputCode, transformOptions); | ||
const result = await babel__namespace.transformAsync(inputCode, transformOptions); | ||
const { | ||
@@ -283,3 +282,3 @@ code, | ||
let { | ||
extensions = babel.DEFAULT_EXTENSIONS, | ||
extensions = babel__namespace.DEFAULT_EXTENSIONS, | ||
// rollup uses sourcemap, babel uses sourceMaps | ||
@@ -437,3 +436,3 @@ // just normalize them here so people don't have to worry about it | ||
return babel.buildExternalHelpers(null, 'module'); | ||
return babel__namespace.buildExternalHelpers(null, 'module'); | ||
}, | ||
@@ -524,4 +523,4 @@ | ||
exports.createBabelOutputPluginFactory = createBabelOutputPluginFactory; | ||
exports.default = getBabelInputPlugin; | ||
exports["default"] = getBabelInputPlugin; | ||
exports.getBabelInputPlugin = getBabelInputPlugin; | ||
exports.getBabelOutputPlugin = getBabelOutputPlugin; |
{ | ||
"name": "@rollup/plugin-babel", | ||
"version": "5.3.0", | ||
"version": "5.3.1", | ||
"publishConfig": { | ||
@@ -9,3 +9,6 @@ "access": "public" | ||
"license": "MIT", | ||
"repository": "rollup/plugins", | ||
"repository": { | ||
"url": "rollup/plugins", | ||
"directory": "packages/babel" | ||
}, | ||
"author": "Rich Harris", | ||
@@ -21,13 +24,10 @@ "homepage": "https://github.com/rollup/plugins/tree/master/packages/babel#readme", | ||
"build": "rollup -c", | ||
"ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov", | ||
"ci:lint": "pnpm run build && pnpm run lint", | ||
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov", | ||
"ci:lint": "pnpm build && pnpm lint", | ||
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}", | ||
"ci:test": "pnpm run test -- --verbose", | ||
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package", | ||
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md", | ||
"lint:js": "eslint --fix --cache src test", | ||
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package", | ||
"ci:test": "pnpm test -- --verbose", | ||
"prebuild": "del-cli dist", | ||
"prepublishOnly": "pnpm run lint && pnpm run test && pnpm run build && pnpm run test:ts", | ||
"pretest": "pnpm run build", | ||
"prerelease": "pnpm build", | ||
"pretest": "pnpm build", | ||
"release": "pnpm plugin:release --workspace-root -- --pkg $npm_package_name", | ||
"test": "ava", | ||
@@ -74,3 +74,3 @@ "test:ts": "tsc types/index.d.ts test/types.ts --noEmit" | ||
"@types/babel__core": "^7.1.9", | ||
"rollup": "^2.23.0", | ||
"rollup": "^2.67.3", | ||
"source-map": "^0.7.3" | ||
@@ -77,0 +77,0 @@ }, |
@@ -330,3 +330,3 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-babel | ||
export default createBabelInputPluginFactory(babelCore => { | ||
export default createBabelInputPluginFactory((babelCore) => { | ||
function myPlugin() { | ||
@@ -333,0 +333,0 @@ return { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
64840
961