babel-plugin-transform-postcss icon indicating copy to clipboard operation
babel-plugin-transform-postcss copied to clipboard

Module resolver

Open Danetag opened this issue 7 years ago • 1 comments

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!

Danetag avatar Aug 20 '17 15:08 Danetag

@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).

wbyoung avatar Sep 10 '17 22:09 wbyoung