Skip to content

Commit

Permalink
remove the plugins already in preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Jul 11, 2018
1 parent a509803 commit 0d7396b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 50 deletions.
9 changes: 1 addition & 8 deletions packages/babel-preset-stage-0/README.md
Expand Up @@ -55,15 +55,8 @@ And without reference to any Stage preset:
// Stage 3
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-async-generator-functions",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings",
["@babel/plugin-proposal-object-rest-spread", {
"loose": false,
"useBuiltIns": false
}],
"@babel/plugin-proposal-optional-catch-binding",
"@babel/plugin-proposal-unicode-property-regex",
"@babel/plugin-proposal-json-strings"
]
}
```
Expand Down
9 changes: 1 addition & 8 deletions packages/babel-preset-stage-1/README.md
Expand Up @@ -58,15 +58,8 @@ And without reference to any Stage preset:
// Stage 3
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-async-generator-functions",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings",
["@babel/plugin-proposal-object-rest-spread", {
"loose": false,
"useBuiltIns": false
}],
"@babel/plugin-proposal-optional-catch-binding",
"@babel/plugin-proposal-unicode-property-regex",
"@babel/plugin-proposal-json-strings"
]
}
```
Expand Down
9 changes: 1 addition & 8 deletions packages/babel-preset-stage-2/README.md
Expand Up @@ -47,15 +47,8 @@ And without reference to any Stage preset:
// Stage 3
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-async-generator-functions",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings",
["@babel/plugin-proposal-object-rest-spread", {
"loose": false,
"useBuiltIns": false
}],
"@babel/plugin-proposal-optional-catch-binding",
"@babel/plugin-proposal-unicode-property-regex",
"@babel/plugin-proposal-json-strings"
]
}
```
Expand Down
9 changes: 1 addition & 8 deletions packages/babel-preset-stage-3/README.md
Expand Up @@ -18,15 +18,8 @@ If you want the same configuration as before, you can use this configuration.
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-async-generator-functions",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings",
["@babel/plugin-proposal-object-rest-spread", {
"loose": false,
"useBuiltIns": false
}],
"@babel/plugin-proposal-optional-catch-binding",
"@babel/plugin-proposal-unicode-property-regex",
"@babel/plugin-proposal-json-strings"
]
}
```
Expand Down
9 changes: 1 addition & 8 deletions packages/babel-preset-stage-3/src/index.js
Expand Up @@ -15,15 +15,8 @@ If you want the same configuration as before, you can use this configuration.
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-async-generator-functions",
["@babel/plugin-proposal-class-properties", { "loose": false }],
"@babel/plugin-proposal-json-strings",
["@babel/plugin-proposal-object-rest-spread", {
"loose": false,
"useBuiltIns": false
}],
"@babel/plugin-proposal-optional-catch-binding",
"@babel/plugin-proposal-unicode-property-regex",
"@babel/plugin-proposal-json-strings"
]
}
Expand Down
10 changes: 0 additions & 10 deletions packages/babel-standalone/src/preset-stage-3.js
@@ -1,31 +1,21 @@
import syntaxDynamicImport from "@babel/plugin-syntax-dynamic-import";
import syntaxImportMeta from "@babel/plugin-syntax-import-meta";
import transformAsyncGeneratorFunctions from "@babel/plugin-proposal-async-generator-functions";
import transformClassProperties from "@babel/plugin-proposal-class-properties";
import transformJsonStrings from "@babel/plugin-proposal-json-strings";
import transformObjectRestSpread from "@babel/plugin-proposal-object-rest-spread";
import transformOptionalCatchBinding from "@babel/plugin-proposal-optional-catch-binding";
import transformUnicodePropertyRegex from "@babel/plugin-proposal-unicode-property-regex";

export default (_, opts) => {
let loose = false;
let useBuiltIns = false;

if (opts !== undefined) {
if (opts.loose !== undefined) loose = opts.loose;
if (opts.useBuiltIns !== undefined) useBuiltIns = opts.useBuiltIns;
}

return {
plugins: [
syntaxDynamicImport,
syntaxImportMeta,
transformAsyncGeneratorFunctions,
[transformClassProperties, { loose }],
transformJsonStrings,
[transformObjectRestSpread, { loose, useBuiltIns }],
transformOptionalCatchBinding,
transformUnicodePropertyRegex,
],
};
};

0 comments on commit 0d7396b

Please sign in to comment.