Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

feat: Add support for Babel 7.0.0 #63

Merged
merged 4 commits into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"standard-version": "^4.2.0"
},
"peerDependencies": {
"babel-core": "^6.0.0",
"babel-core": "^6.0.0 || >7.0.0-alpha",
"babel-plugin-module-resolver": "^3.0.0-beta"
},
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ function getPlugins(file, target) {
filename: file,
});

// Babel 7.0.0
if (!OptionManager.memoisedPlugins) {
return result.plugins.filter((plugin) => {
const plug = plugin[0] || plugin;
return plug.key.indexOf('babel-plugin-module-resolver') > -1;
});
}

// Babel 6.0.0
return result.plugins.filter((plugin) => {
const plug = OptionManager.memoisedPlugins.find(item => item.plugin === plugin[0]);

Expand Down