1
- import resolve from '@rollup/plugin-node-resolve'
2
- import commonjs from '@rollup/plugin-commonjs'
3
- import typescript from '@rollup/plugin-typescript'
4
- import { dts } from 'rollup-plugin-dts'
5
- // import css from "rollup-plugin-import-css";
1
+ import resolve from '@rollup/plugin-node-resolve' ;
2
+ import commonjs from '@rollup/plugin-commonjs' ;
3
+ import typescript from '@rollup/plugin-typescript' ;
4
+ import { dts } from 'rollup-plugin-dts' ;
6
5
import postcss from 'rollup-plugin-postcss' ;
7
- // import autoprefixer from 'autoprefixer';
8
- //NEW
9
- import terser from '@rollup/plugin-terser' ;
6
+ import terser from '@rollup/plugin-terser' ; // Update import for terser
10
7
11
- const packageJson = require ( './package.json' )
8
+ const packageJson = require ( './package.json' ) ;
12
9
13
10
export default [
14
11
{
15
12
input : 'src/index.ts' ,
16
- output : [
17
-
18
- {
19
- file : packageJson . main ,
20
- format : 'esm' ,
21
- sourcemap : true ,
22
- } ,
23
- ] ,
13
+ output : {
14
+ file : packageJson . main ,
15
+ format : 'esm' ,
16
+ sourcemap : true ,
17
+ } ,
24
18
plugins : [
25
- // NEW
26
19
typescript ( {
27
- tsconfig : './tsconfig.json' // Path to your tsconfig.json
20
+ tsconfig : './tsconfig.json' ,
21
+ // Set include option to include CSS files in TypeScript bundle
22
+ include : [ / \. t s x ? $ / , / \. c s s $ / ] ,
28
23
} ) ,
29
- // css(),
30
- // peerDepsExternal(),
31
-
32
24
resolve ( ) ,
33
25
commonjs ( ) ,
34
26
postcss ( {
35
- plugins : [ ] ,
36
- // sourceMap: true,
37
- extract : true ,
38
- inject :false ,
39
- extensions :[ '.css' ] ,
27
+ extract : false , // Disable CSS extraction
28
+ inject : true , // Inject CSS into the bundle
40
29
minimize : true ,
41
-
42
- } ) ,
43
- // css(),
44
-
45
- // NEW
30
+ // Add any additional postcss plugins if needed
31
+ } ) ,
46
32
terser ( ) ,
47
33
] ,
48
34
} ,
49
35
{
50
36
input : 'dist/cjs/types/src/index.d.ts' ,
51
- output : [ { file : 'dist/index.d.ts' , format : 'esm' } ] ,
37
+ output : { file : 'dist/index.d.ts' , format : 'esm' } ,
52
38
plugins : [ dts ( ) ] ,
53
39
external : [ / \. c s s $ / ] ,
54
40
} ,
55
- ]
41
+ ] ;
0 commit comments