Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module resolver #48

Open
Danetag opened this issue Aug 20, 2017 · 1 comment
Open

Module resolver #48

Danetag opened this issue Aug 20, 2017 · 1 comment

Comments

@Danetag
Copy link

Danetag commented Aug 20, 2017

Hello!

I've been trying to use babel-plugin-transform-postcss but I keep having ENOENT due to the path used in the project. I didn't want to end up with ../../grid.css so I added in my webpack configuration my src folder in the resolve module array.

resolve: {
    modules: [
      'node_modules',
      'src'
    ],
    ...
    }
  },

How can I do the same here?

Thanks!

@wbyoung
Copy link
Owner

wbyoung commented Sep 10, 2017

@Danetag I'm open to a PR to try to support that, but I don't personally use wepback, so I'm not sure where that makes its way into babel or other module resolvers.

One way is to add a symlink to src inside of node_modules.

Generally, I've tried to avoid both of these types of practices in the past and instead use relative paths. I know there are strong opinions out there to use relative paths, but I'm open to trying to support this if you can track how this plugin would know where modules are located (i.e. if some env var is set).

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

No branches or pull requests

2 participants