css-modules / postcss-icss-values

Pass arbitrary constants between your module files
MIT License
203 stars 18 forks source link

Is it possible to use webpack resolution aliases when importing values? #80

Closed mattkauffman23 closed 7 years ago

mattkauffman23 commented 7 years ago

We use webpack aliases to simplify importing modules in our es6 code. We'd like to do something similar when importing values in our css files. Is there a way to do either absolute paths for value imports (considering the project as the root for the path) or get the value import to check some sort of configuration, similar to how aliasing works in webpack?

rpunkfu commented 7 years ago

It is, if you configure aliases in webpack config it works in both js and css

mattkauffman23 commented 7 years ago

@rpunkfu sorry just getting back to this. Took another look and I was missing css in extensions part of resolve in my webpack config. Apologies for the trouble. Closing.

rpunkfu commented 7 years ago

No need to be sorry haha, glad you worked it out ;)