Skip to content

Commit

Permalink
build: add rollup config to handle css modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ickas committed Jan 9, 2024
1 parent 409fd4e commit cb22341
Show file tree
Hide file tree
Showing 3 changed files with 1,025 additions and 402 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-is": "^17.0.1",
"rollup-plugin-postcss": "^4.0.2",
"size-limit": "^11.0.1",
"storybook": "^7.6.7",
"tsdx": "^0.14.1",
Expand Down
14 changes: 14 additions & 0 deletions tsdx.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const postcss = require('rollup-plugin-postcss');

module.exports = {
rollup(config, options) {
config.plugins.push(
postcss({
modules: true,
// only write out CSS for the first bundle (avoids pointless extra files):
extract: !!options.writeMeta,
})
);
return config;
},
};
Loading

0 comments on commit cb22341

Please sign in to comment.