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, },