Skip to content

Commit

Permalink
Modified lib/index.js
Browse files Browse the repository at this point in the history
Modified   lib/plugins.js
  • Loading branch information
bplok20010 committed Jun 2, 2020
1 parent 3cca234 commit a15f23c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function _default(api, opts) {
systemjs: require.resolve("@babel/plugin-transform-modules-systemjs")
};
var modulePlugin = modulesMap[modules] && [modulesMap[modules], {
strictMode: strictMode
strictMode
}]; // class-properties 开启 `loose` 后 private-methods 也要同时开启

return [// useFlow && [
Expand All @@ -38,22 +38,19 @@ function _default(api, opts) {
// modules: amd => Promise.resolve.then( () => require([path], callback) )
// ...
require.resolve("@babel/plugin-syntax-dynamic-import"), require.resolve("@babel/plugin-proposal-async-generator-functions"), [require.resolve("@babel/plugin-proposal-decorators"), {
decoratorsBeforeExport: decoratorsBeforeExport,
decoratorsBeforeExport,
legacy: false
}], // Enable loose mode to use assignment instead of defineProperty
[require.resolve("@babel/plugin-proposal-class-properties"), {
loose: true
}], [require.resolve("@babel/plugin-proposal-private-methods"), {
loose: true
}], require.resolve("@babel/plugin-proposal-do-expressions"), require.resolve("@babel/plugin-proposal-export-default-from"), require.resolve("@babel/plugin-proposal-export-namespace-from"), require.resolve("@babel/plugin-proposal-function-bind"), require.resolve("@babel/plugin-proposal-function-sent"), require.resolve("@babel/plugin-proposal-logical-assignment-operators"), require.resolve("@babel/plugin-proposal-nullish-coalescing-operator"), require.resolve("@babel/plugin-proposal-numeric-separator"), require.resolve("@babel/plugin-proposal-optional-chaining"), // require.resolve("@babel/plugin-proposal-partial-application"),
require.resolve("@babel/plugin-proposal-throw-expressions"), require.resolve("@babel/plugin-proposal-optional-catch-binding"), [require.resolve("@babel/plugin-proposal-object-rest-spread"), {
}], require.resolve("@babel/plugin-proposal-do-expressions"), require.resolve("@babel/plugin-proposal-export-default-from"), require.resolve("@babel/plugin-proposal-export-namespace-from"), require.resolve("@babel/plugin-proposal-function-bind"), require.resolve("@babel/plugin-proposal-function-sent"), require.resolve("@babel/plugin-proposal-nullish-coalescing-operator"), require.resolve("@babel/plugin-proposal-numeric-separator"), require.resolve("@babel/plugin-proposal-optional-chaining"), require.resolve("@babel/plugin-proposal-optional-catch-binding"), [require.resolve("@babel/plugin-proposal-object-rest-spread"), {
// 使用Object.assign代替babel的helper方法
loose: true,
useBuiltIns: true
}], require.resolve("@babel/plugin-syntax-top-level-await"), // require.resolve("@babel/plugin-transform-react-jsx"),
// require.resolve("@babel/plugin-transform-proto-to-assign"), //Internet Explorer(10 and below)
[require.resolve("@babel/plugin-proposal-pipeline-operator"), {
proposal: "minimal"
}], runtimeOptions && [require.resolve("@babel/plugin-transform-runtime"), runtimeOptions], require.resolve("babel-plugin-dev-expression"), //Replaces __DEV__ with process.env.NODE_ENV !== 'production'
runtimeOptions && [require.resolve("@babel/plugin-transform-runtime"), runtimeOptions], require.resolve("babel-plugin-dev-expression"), //Replaces __DEV__ with process.env.NODE_ENV !== 'production'
modulePlugin].filter(Boolean);
}

0 comments on commit a15f23c

Please sign in to comment.