elado / next-with-less

Next.js + Less CSS Support
MIT License
143 stars 24 forks source link

fix: css loader options editable (#10) #29

Closed xuerzong closed 1 year ago

xuerzong commented 1 year ago

Make css loader options editable, such as mode: 'pure' to mode: 'local'

elado commented 1 year ago

This plugin uses the same css-loader config that Next.js uses intentionally. If this customization exists in Next.js, then applying it in Next's config will also make it available in the less configuration. If not, and this config is absolutely needed, you can create another plugin, e.g. withCssLoaderConfig that is similar to this one and apply it before withLess, that way it'll clone the customized css-loader. Generally Next.js is opinionated about how CSS is loaded...