egoist / rollup-plugin-postcss

Seamless integration between Rollup and PostCSS.
MIT License
676 stars 217 forks source link

[Question] postcss.config.js support? EOM #13

Closed quantuminformation closed 6 years ago

egoist commented 7 years ago

We can use https://github.com/michael-ciniawsky/postcss-load-config , PR welcome.

egoist commented 6 years ago

It's supported in v1.0

francoisromain commented 6 years ago

@egoist Thank you ! 🙏

francoisromain commented 6 years ago

Is it possible to load the config from package.json?

egoist commented 6 years ago

sure, any thing that postcss-load-config supports.

francoisromain commented 6 years ago

I updated from v. 0.5.6 to 1.0.1 (in this project: https://github.com/francoisromain/camomile-ui/blob/master/build/rollup.config.dist.js)

The postcss config is imported correctly from package.json.

With the previous version, I had all the css extracted in a single dist/styles.css file (from vue templates and from the main css file imported in js).

With version 1, /dist/styles.css only contains css from the vue templates. The css imported in the main js file is extracted in its own css file named after the exported js file (/dist/my-project.common.css), which is not what I want.

my rollup config with v0.5.6:

vue({
        compileTemplate: true,
        css: '../dist/styles.css'
      }),
      postcss({
        plugins: postcssPlugins,
        extract: '../dist/styles.css'
      }),

and now with v.1.0.1

      vue({
        compileTemplate: true,
        css: '../dist/styles.css'
      }),
      postcss({
        extract: '../dist/styles.css'
      }),

What is the config to export all the css in a single file? Thank you

francoisromain commented 6 years ago

I opened an issue about this last question: https://github.com/egoist/rollup-plugin-postcss/issues/59