quilt
quilt copied to clipboard
Make CSS imports pure so that when imported for side effects, they aren't included in the resulting bundle
Looked at this. The rollup main part of the rollup plugin is https://github.com/lemonmade/quilt/blob/f775fdfb1a5d3473dd6f8d2ea9c66f96aa77606c/packages/rollup/source/features/css.ts#L41-L49, and with changes to the following, CSS imported by the browser entry is correctly handled:
return {
code: exports
? `const module = /* #__PURE__ */ JSON.parse(${JSON.stringify(
JSON.stringify(exports),
)});\nexport default module;`
: `export default undefined;`,
map: {mappings: ''},
// moduleSideEffects: 'no-treeshake',
};
However, CSS outside the browser entry point is not preserved.