@@ -7,32 +7,39 @@ import postcss from "rollup-plugin-postcss";
77const packageJson = require ( "./package.json" ) ;
88
99export default [
10- {
11- input : "src/index.ts" ,
12- output : [
13- {
14- file : packageJson . main ,
15- format : "cjs" ,
16- sourcemap : true ,
17- } ,
18- {
19- file : packageJson . module ,
20- format : "esm" ,
21- sourcemap : true ,
22- } ,
23- ] ,
24- plugins : [
25- resolve ( ) ,
26- commonjs ( ) ,
27- typescript ( { tsconfig : "./tsconfig.json" } ) ,
28- postcss ( ) ,
29- ] ,
30- external : [ "react" , "react-dom" ] ,
31- } ,
32- {
33- input : "dist/esm/types/index.d.ts" ,
34- output : [ { file : "dist/index.d.ts" , format : "esm" } ] ,
35- plugins : [ dts ( ) ] ,
36- external : [ / \. ( c s s | l e s s | s c s s ) $ / ] ,
37- } ,
38- ] ;
10+ {
11+ input : "src/index.ts" ,
12+ output : [
13+ {
14+ file : packageJson . main ,
15+ format : "cjs" ,
16+ sourcemap : true ,
17+ exports : "auto" ,
18+ } ,
19+ {
20+ file : packageJson . module ,
21+ format : "esm" ,
22+ sourcemap : true ,
23+ } ,
24+ ] ,
25+ plugins : [
26+ resolve ( ) ,
27+ commonjs ( ) ,
28+ typescript ( { tsconfig : "./tsconfig.json" } ) ,
29+ typescript ( {
30+ tsconfig : "./tsconfig.json" ,
31+ declaration : true ,
32+ declarationDir : "dist" ,
33+ outputToFilesystem : true , // Required for proper type output in Rollup 4
34+ } ) ,
35+ postcss ( ) ,
36+ ] ,
37+ external : [ "react" , "react-dom" ] ,
38+ } ,
39+ {
40+ input : "dist/esm/types/index.d.ts" ,
41+ output : [ { file : "dist/index.d.ts" , format : "esm" } ] ,
42+ plugins : [ dts ( ) ] ,
43+ external : [ / \. ( c s s | l e s s | s c s s ) $ / ] ,
44+ } ,
45+ ] ;
0 commit comments