egoist / rollup-plugin-postcss

Seamless integration between Rollup and PostCSS.
MIT License
673 stars 215 forks source link

How to make less and modules work together? #209

Open baurine opened 4 years ago

baurine commented 4 years ago

As my understanding from the README, I just need to install the less as the dependency and set modules: true then I can import less file as css modules like this:

// MyComponent.tsx
import styles from "./MyComponent.less"

But I get the errror: [!] (rpt2 plugin) Error: ... semantic error TS2307 Cannot find module './MyComponent.less' after running the rollup -c.

I use the rollup-plugin-css version 1.6.2 and rollup version 0.62.0

My rollup.config.js:

  ...
  plugins: [
    external(),
    postcss({
      modules: true
    }),
    ...
himself65 commented 4 years ago

try to update rollup to 1.x