Closed alexander-schranz closed 2 months ago
You need provide options for enhanced-resolve
, for example we use these options https://github.com/webpack-contrib/css-loader/blob/master/src/index.js#L58 in css-loader
@alexander-akait Thx for the response do you knowhow. Do you know how I can inject the options that it are the same which my webpack configuration is using. I'm trying to avoid to duplicate things here from my webpack configuration.
webpack loaders have this.getResolve(options)
API, we pass loader context here https://github.com/webpack-contrib/postcss-loader/blob/14f83a0c953f558e5ed07aa459b8e5e320ea2aa5/README.md#function, so you can use this API, if you build it with webpack
@alexander-akait Thx for all your help! Is that available in some case outside, because postcss is in our cases configured in the postcss.config.js
where no this.getResolve
exists. Any way like above import the enhancedResolve
and then get from webpack the correct configuration for it to use it then inside the resolve method of the postcss.config.js.
You can ask developer to provide an option to use enhanced-resolve
, we can't fix it here, sorry
This is not a issue more a question. Currently the postcss import plugin is loading the css file itself. They have an option of resolving the postcss manually e.g.:
As you see it looks really hacky.
In the webpack resolve I'm just using for other files something like this e.g.:
This work like expected. But only for the files imported in
.js
files not over the@import
. I'm now trying to use the resolver directly but I'm always getting strange errors like missing property or indexOf when I'm going with:So my question is if somebody have experience with using the resolver of webpack inside the postcss import plugin