From bc3e00ad591488b76cda0817da92e2f410b8454e Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 28 Oct 2026 21:12:56 +0100 Subject: [PATCH] feat!: ship the CSS as esm/index.css instead of injecting it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: the library no longer injects its CSS into the page. Import it once in the entry point of your application: import '@mll-lab/react-components/esm/index.css'; 🤖 Generated with Claude Code --- README.md | 6 ++++++ rollup.config.js | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 135ac299..7569f174 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ Shared React components of MLL ## Usage +Import the styles once in the entry point of your application: + +```ts +import '@mll-lab/react-components/esm/index.css'; +``` + To set up proper styles, wrap your application in ``: ```tsx diff --git a/rollup.config.js b/rollup.config.js index 5b31cd1a..a2c0ee6d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -19,11 +19,13 @@ export default { // https://rollupjs.org/configuration-options/#output-interop // Necessary in order for jest in consumers to work interop: 'auto', + assetFileNames: '[name][extname]', }, { file: pkg.module, format: 'esm', sourcemap: true, + assetFileNames: '[name][extname]', }, ], @@ -47,6 +49,9 @@ export default { exclude: '**/*.(test|stories).(ts|tsx)', }), styles({ + mode: ['extract', 'index.css'], + // Keeps url('#linearGradient-1') of antd's Empty instead of emitting it as an asset + url: false, less: { javascriptEnabled: true, },