rollup-plugin-postcss
rollup-plugin-postcss copied to clipboard
Code Splitting, multiple entry points
Hi!
does rollup-plugin-postcss works with rollups experimentalCodeSplitting option ?
I need to use multiple inputs what seems to work in general for .js content, but it looks that postcss does not extract any css files when experimentalCodeSplitting is set to true
I'm having the same problem.
This works
import postcss from 'rollup-plugin-postcss';
export default {
input: 'components/header/header.js',
output: {
file: 'dist/index.js',
sourceMap: true,
format: 'cjs',
},
plugins: [
postcss({
extract: true,
plugins: [],
sourceMap: true,
})
]
};
but this does not
import postcss from 'rollup-plugin-postcss';
export default {
input: ['components/button/button.js', 'components/header/header.js'],
experimentalCodeSplitting: true,
output: {
dir: 'dist/',
sourceMap: true,
format: 'cjs',
},
plugins: [
postcss({
extract: true,
plugins: [],
sourceMap: true,
})
]
};
I get [!] (postcss plugin) TypeError: Path must be a string. Received undefined
You must set extract to the path where you want the css to be extracted, but sadly it will not extract one css file per bundle, that would be pretty cool!
This seems to not work when sourceMap: true. It looks like PR #136 might have fixed it, but I haven't run the most recent (unreleased) code. @egoist, any idea when that might get released?
Seems to work fine for me with the stable code splitting, however, you indeed only get a single SCSS bundle.