Skip to content

Commit

Permalink
Use helpers from @babel/helper-compilation-targets
Browse files Browse the repository at this point in the history
  • Loading branch information
existentialism committed Feb 4, 2020
1 parent 9075502 commit 217a862
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 211 deletions.
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,8 @@ module.exports = {
// if no targets are setup, assume that all plugins are required
if (!targets) { return true; }

const isPluginRequired = require('@babel/preset-env').isPluginRequired;
const pluginList = require('@babel/preset-env/data/plugins');

return isPluginRequired(targets, pluginList[pluginName]);
const isPluginRequired = require('@babel/helper-compilation-targets').isRequired;
return isPluginRequired(pluginName, targets);
},

_getAddonOptions() {
Expand Down Expand Up @@ -476,7 +474,7 @@ module.exports = {
_getTargets() {
let targets = this.project && this.project.targets;

let parser = require('@babel/preset-env/lib/targets-parser').default;
let parser = require('@babel/helper-compilation-targets').default;
if (typeof targets === 'object' && targets !== null) {
return parser(targets);
} else {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@
"test:node:debug": "mocha debug node-tests"
},
"dependencies": {
"@babel/core": "^7.8.3",
"@babel/core": "^7.8.4",
"@babel/helper-compilation-targets": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-transform-modules-amd": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/polyfill": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"@babel/runtime": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/runtime": "^7.8.4",
"amd-name-resolver": "^1.2.1",
"babel-plugin-debug-macros": "^0.3.0",
"babel-plugin-ember-data-packages-polyfill": "^0.1.1",
Expand Down

0 comments on commit 217a862

Please sign in to comment.