Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove the plugins already in preset-env
- Loading branch information
Showing
6 changed files
with
5 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
], | ||
}; | ||
}; |