Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Commit

Permalink
Normalize module format of plugins/built-ins data (#376)
Browse files Browse the repository at this point in the history
* Reference plugins json instead of module in normalize-options.js

* Make plugins module format match built-ins module
  • Loading branch information
rtsao authored and hzoo committed Jul 17, 2017
1 parent db25efd commit 51d9e6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions data/plugin-features.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
// es2015
const es2015 = {
"check-es2015-constants": {
features: [
"const",
Expand Down Expand Up @@ -107,16 +106,18 @@ module.exports = {
features: [
"generators",
],
},
}
};

// es2016
const es2016 = {
"transform-exponentiation-operator": {
features: [
"exponentiation (**) operator",
],
},
}
};

// es2017
const es2017 = {
"transform-async-to-generator": {
features: [
"async functions",
Expand All @@ -128,3 +129,5 @@ module.exports = {
],
}
};

module.exports = Object.assign({}, es2015, es2016, es2017);
4 changes: 2 additions & 2 deletions src/normalize-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import invariant from "invariant";
import builtInsList from "../data/built-ins.json";
import { defaultWebIncludes } from "./default-includes";
import moduleTransformations from "./module-transformations";
import pluginFeatures from "../data/plugin-features";
import pluginsList from "../data/plugins.json";

const validIncludesAndExcludes = [
...Object.keys(pluginFeatures),
...Object.keys(pluginsList),
...Object.keys(moduleTransformations).map((m) => moduleTransformations[m]),
...Object.keys(builtInsList),
...defaultWebIncludes,
Expand Down

0 comments on commit 51d9e6d

Please sign in to comment.