Skip to content

Commit 0f319da

Browse files
committed
Add support for dynamic import
Signed-off-by: Vihan <contact@vihan.org>
1 parent 8fcd70b commit 0f319da

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "babel-plugin-root-import",
3-
"version": "5.1.0",
2+
"name": "babel-7-plugin-root-import",
3+
"version": "5.2.0",
44
"description": "Babel Plugin to enable relative root-import",
55
"author": "Michael J. Zoidl <github@michaelzoidl.com>",
66
"license": "MIT",

plugin/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const traverseExpression = (t, arg) => {
5050
export default ({ 'types': t }) => {
5151
const visitor = {
5252
CallExpression(path, state) {
53-
if (path.node.callee.name !== 'require') {
53+
if (!['require', 'import'].includes(path.node.callee.name)) {
5454
return;
5555
}
5656

0 commit comments

Comments
 (0)