Archive syntax plugins enabled by default (#10820)
* Remove syntax plugins enabled by default Moved to babel-archive: babel/babel-archive@8f23ddce03 - `@babel/plugin-syntax-async-generators` - `@babel/plugin-syntax-bigint` - `@babel/plugin-syntax-dynamic-import` - `@babel/plugin-syntax-json-strings` - `@babel/plugin-syntax-nullish-coalescing-operator` - `@babel/plugin-syntax-object-rest-spread` - `@babel/plugin-syntax-optional-catch-binding` - `@babel/plugin-syntax-optional-chaining` * Fix build script * Fix jest config * Remove archived plugins from tests
This commit is contained in:
parent
c7f7f9b8b5
commit
a677d59a63
@ -1,3 +1,19 @@
|
||||
// These packages undet the @babel namespace aren't in this monorepo.
|
||||
const externalBabelPackages = [
|
||||
"plugin-syntax-async-generators",
|
||||
"plugin-syntax-bigint",
|
||||
"plugin-syntax-dynamic-import",
|
||||
"plugin-syntax-json-strings",
|
||||
"plugin-syntax-nullish-coalescing-operator",
|
||||
"plugin-syntax-object-rest-spread",
|
||||
"plugin-syntax-optional-catch-binding",
|
||||
"plugin-syntax-optional-chaining",
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const monorepoPackagePattern =
|
||||
`^@babel/(?!eslint-)(?!${externalBabelPackages.join("|")})([a-zA-Z0-9_-]+)$`;
|
||||
|
||||
module.exports = {
|
||||
collectCoverageFrom: [
|
||||
"packages/*/src/**/*.mjs",
|
||||
@ -46,7 +62,7 @@ module.exports = {
|
||||
"<rootDir>/build/",
|
||||
],
|
||||
moduleNameMapper: {
|
||||
"^@babel/(?!eslint-)([a-zA-Z0-9_-]+)$": "<rootDir>/packages/babel-$1/",
|
||||
[monorepoPackagePattern]: "<rootDir>/packages/babel-$1/",
|
||||
"^@babel/eslint-([a-zA-Z0-9_-]+)$": "<rootDir>/eslint/babel-eslint-$1/",
|
||||
},
|
||||
};
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
"plugins": [
|
||||
["proposal-decorators", { "decoratorsBeforeExport": false }],
|
||||
"proposal-class-properties",
|
||||
"syntax-async-generators",
|
||||
["external-helpers", { "helperVersion": "7.1.5" }]
|
||||
]
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
{
|
||||
"helperVersion": "7.1.5"
|
||||
}
|
||||
],
|
||||
"syntax-async-generators"
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"syntax-dynamic-import",
|
||||
"transform-modules-amd",
|
||||
"external-helpers"
|
||||
]
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"syntax-dynamic-import",
|
||||
"transform-modules-commonjs",
|
||||
"external-helpers"
|
||||
]
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
{
|
||||
"validateLogs": true,
|
||||
"plugins": [
|
||||
"syntax-dynamic-import",
|
||||
"transform-modules-systemjs",
|
||||
"external-helpers"
|
||||
]
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"proposal-logical-assignment-operators",
|
||||
"syntax-nullish-coalescing-operator"
|
||||
"proposal-logical-assignment-operators"
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"syntax-async-generators",
|
||||
"proposal-object-rest-spread",
|
||||
["external-helpers", { "helperVersion": "7.1.5" }]
|
||||
]
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-async-generators
|
||||
|
||||
> Allow parsing of async generator functions
|
||||
|
||||
See our website [@babel/plugin-syntax-async-generators](https://babeljs.io/docs/en/next/babel-plugin-syntax-async-generators.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-async-generators
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-async-generators --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-async-generators",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of async generator functions",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-async-generators",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("asyncGenerators");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
node_modules
|
||||
*.log
|
||||
src
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-bigint
|
||||
|
||||
> Allow parsing of BigInt literals
|
||||
|
||||
See our website [@babel/plugin-syntax-bigint](https://babeljs.io/docs/en/next/babel-plugin-syntax-bigint.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-bigint
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-bigint --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-bigint",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of BigInt literals",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-bigint",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-bigint",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("bigInt");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-dynamic-import
|
||||
|
||||
> Allow parsing of import()
|
||||
|
||||
See our website [@babel/plugin-syntax-dynamic-import](https://babeljs.io/docs/en/next/babel-plugin-syntax-dynamic-import.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-dynamic-import
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-dynamic-import --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-dynamic-import",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of import()",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-dynamic-import",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("dynamicImport");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-json-strings
|
||||
|
||||
> Allow parsing of the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings
|
||||
|
||||
See our website [@babel/plugin-syntax-json-strings](https://babeljs.io/docs/en/next/babel-plugin-syntax-json-strings.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-json-strings
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-json-strings --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-json-strings",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-json-strings",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("jsonStrings");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-nullish-coalescing-operator
|
||||
|
||||
> Allow parsing of the nullish-coalescing operator
|
||||
|
||||
See our website [@babel/plugin-syntax-nullish-coalescing-operator](https://babeljs.io/docs/en/next/babel-plugin-syntax-nullish-coalescing-operator.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-nullish-coalescing-operator
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-nullish-coalescing-operator --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-nullish-coalescing-operator",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of the nullish-coalescing operator",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-nullish-coalescing-operator",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-nullish-coalescing-operator",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("nullishCoalescingOperator");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-object-rest-spread
|
||||
|
||||
> Allow parsing of object rest/spread
|
||||
|
||||
See our website [@babel/plugin-syntax-object-rest-spread](https://babeljs.io/docs/en/next/babel-plugin-syntax-object-rest-spread.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-object-rest-spread
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-object-rest-spread --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-object-rest-spread",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of object rest/spread",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-object-rest-spread",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("objectRestSpread");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-optional-catch-binding
|
||||
|
||||
> Allow parsing of optional catch bindings
|
||||
|
||||
See our website [@babel/plugin-syntax-optional-catch-binding](https://babeljs.io/docs/en/next/babel-plugin-syntax-optional-catch-binding.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-optional-catch-binding
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-optional-catch-binding --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-optional-catch-binding",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of optional catch bindings",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-optional-catch-binding",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("optionalCatchBinding");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@ -1,19 +0,0 @@
|
||||
# @babel/plugin-syntax-optional-chaining
|
||||
|
||||
> Allow parsing of optional properties
|
||||
|
||||
See our website [@babel/plugin-syntax-optional-chaining](https://babeljs.io/docs/en/next/babel-plugin-syntax-optional-chaining.html) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-syntax-optional-chaining
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-syntax-optional-chaining --dev
|
||||
```
|
||||
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-optional-chaining",
|
||||
"version": "7.8.0",
|
||||
"description": "Allow parsing of optional properties",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining",
|
||||
"license": "MIT",
|
||||
"type": "commonjs",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.0"
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
|
||||
export default declare(api => {
|
||||
api.assertVersion(7);
|
||||
|
||||
return {
|
||||
name: "syntax-optional-chaining",
|
||||
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
parserOpts.plugins.push("optionalChaining");
|
||||
},
|
||||
};
|
||||
});
|
||||
@ -1,7 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"syntax-jsx",
|
||||
"syntax-optional-chaining",
|
||||
"transform-flow-strip-types"
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"syntax-object-rest-spread",
|
||||
"syntax-optional-chaining",
|
||||
[
|
||||
"transform-modules-commonjs",
|
||||
{ "strict": true, "mjsStrictNamespace": false }
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"syntax-dynamic-import",
|
||||
"syntax-import-meta",
|
||||
"transform-modules-systemjs"
|
||||
]
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
{
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-modules-systemjs",
|
||||
"syntax-object-rest-spread"
|
||||
"transform-modules-systemjs"
|
||||
]
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"transform-destructuring",
|
||||
"transform-parameters",
|
||||
"transform-spread",
|
||||
"syntax-object-rest-spread",
|
||||
"transform-react-constant-elements",
|
||||
"syntax-jsx",
|
||||
"external-helpers"
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"transform-destructuring",
|
||||
"transform-parameters",
|
||||
"transform-spread",
|
||||
"syntax-object-rest-spread",
|
||||
"transform-react-constant-elements",
|
||||
"syntax-jsx",
|
||||
"external-helpers"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,5 +1,4 @@
|
||||
{
|
||||
"plugins": ["syntax-dynamic-import"],
|
||||
"presets": [
|
||||
[
|
||||
"../../../../lib",
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
{
|
||||
"plugins": ["syntax-dynamic-import"],
|
||||
"presets": [
|
||||
[
|
||||
"../../../../lib",
|
||||
|
||||
1
packages/babel-standalone/babel.js.map
Normal file
1
packages/babel-standalone/babel.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -48,12 +48,26 @@ module.exports = function() {
|
||||
}
|
||||
|
||||
const matches = importee.match(/^@babel\/([^/]+)$/);
|
||||
if (matches) {
|
||||
const packageFolderName = `babel-${matches[1]}`;
|
||||
if (!matches) return null;
|
||||
|
||||
// resolve babel package names to their src index file
|
||||
const packageFolder = path.join(dirname, "packages", packageFolderName);
|
||||
const packageJson = require(path.join(packageFolder, "package.json"));
|
||||
const packageFolder = path.join(
|
||||
dirname,
|
||||
"packages",
|
||||
`babel-${matches[1]}`
|
||||
);
|
||||
|
||||
let packageJsonSource;
|
||||
try {
|
||||
packageJsonSource = fs.readFileSync(
|
||||
path.join(packageFolder, "package.json")
|
||||
);
|
||||
} catch (e) {
|
||||
// Some Babel packahes aren't in this repository, but in
|
||||
return null;
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(packageJsonSource);
|
||||
|
||||
const filename =
|
||||
typeof packageJson["browser"] === "string"
|
||||
@ -65,9 +79,6 @@ module.exports = function() {
|
||||
// replace lib with src in the pkg.json entry
|
||||
filename.replace(/^(\.\/)?lib\//, "src/")
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user