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

Issue with babel-plugins which are not following the babel-plugin-*plugin-name* naming convention #1549

Closed
ghost opened this issue Oct 28, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Oct 28, 2016

Description

The babel-root-import plugin doesn't work with brunch.

Expected behavior

bable-root-import allows to use a a prefix to resolve modules from your project structure.

instead of

import Foo from '../../components/Foo.jsx'

you can use

import Foo from '@/components/Foo'

However, to do this, the plugin must be included.

Actual behavior

The problem is, that when I define the plugin in the babel configuration as

"babel-root-import": {}

brunch is looking for

"babel-plugin-babel-root-import"

which doesn't exists.

Actually this is very useful, and could be added to brunch itself. Where you can define the root src path in your project structure.

@denysdovhan
Copy link
Contributor

Hi, @dropfen!

Thanks for reporting! Let's see how can I help you.

@denysdovhan
Copy link
Contributor

denysdovhan commented Dec 23, 2016

Well, first of all, babel-root-import have inconsistent name. That's not in common plugin's name convention. I'm going to open an corresponding issue in its repo.

UPD: Here it is: entwicklerstube/babel-plugin-root-import#63

@denysdovhan
Copy link
Contributor

Hey, @dropfen! Seems like I've fixed this issue by babel/babel-brunch#45.

Can you, please, check with my changes and verify that everything is OK?

paulmillr added a commit to babel/babel-brunch that referenced this issue Dec 27, 2016
@shvaikalesh
Copy link
Contributor

Fixed in babel-brunch/master.

@ghost
Copy link
Author

ghost commented Dec 31, 2016

@denysdovhan & @shvaikalesh Thanks guys, I've checked the changes should be fine, but I could't check it because I updated React at the same time and this problem happened #1591

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants