mizdra / happy-css-modules

Typed, definition jumpable CSS Modules. Moreover, easy!
MIT License
217 stars 5 forks source link

Support `resolve.alias` for webpack #96

Closed mizdra closed 1 year ago

mizdra commented 1 year ago

ref: https://webpack.js.org/configuration/resolve/#resolvealias

mizdra commented 1 year ago

Implement here.

https://github.com/mizdra/checkable-css-modules/blob/6aaa42a96a7fa0c9bd80afa4c89500ffaec4773e/src/resolver/webpack-resolver.ts#L11-L19

mizdra commented 1 year ago

If you are using webpack.config.js wrapped with tools such as create-react-app or next.js, I have found that approaches like https://github.com/mizdra/happy-css-modules/issues/96#issue-1360911231 don't work.

Perhaps an interface like --webpack-resolve-alias='{"util": "src/util"}' would be better.