egoist / rollup-plugin-postcss

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

Trim inline sourcemaps emitted from other rollup plugin #208

Open dimasahmad opened 4 years ago

dimasahmad commented 4 years ago

I'm using svelte and when I enable emitCss option, rollup-plugin-postcss should receive css "files" with inline sourcemap.

rollup.config.js

...

plugins: [
    svelte({
        ...
        // Emit CSS as "files" for other plugins to process
        emitCss: true
    }),

    postcss({
        extract: true,
        sourceMap: true
    })

    ...
]

...

But the output has 2 sourcemaps, the inline sorcemap from the emitted svelte css files and from the postcss generated sourcemap. It would be nice to trim the emitted inline sourcemap and extract it to the specified .map file, reducing the file size significantly.

mindplay-dk commented 3 years ago

Unfortunately, sourceMap: true doesn't seem to work as expected, even with the built-in support for nanocss.

If I use a simple postcss({ minimize: true, sourceMap: true }), the CSS sourcemap ends up inline - I'm not sure what sourceMap: "inline", which is mentioned in the documentation, would do differently? It seems the sourcemap is inline no matter what I do.