File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ import peerDepsExternal from 'rollup-plugin-peer-deps-external'
2+ import resolve from '@rollup/plugin-node-resolve'
3+ import commonjs from '@rollup/plugin-commonjs'
4+ import typescript from '@rollup/plugin-typescript'
5+ import dts from 'rollup-plugin-dts'
6+ import terser from '@rollup/plugin-terser'
7+ import postcss from 'rollup-plugin-postcss'
8+
9+ const packageJson = require ( './package.json' )
10+
11+ export default [
12+ {
13+ input : 'src/index.ts' ,
14+ output : [
15+ {
16+ file : packageJson . main ,
17+ format : 'cjs' ,
18+ sourcemap : true
19+ } ,
20+ {
21+ file : packageJson . module ,
22+ format : 'esm' ,
23+ sourcemap : true
24+ }
25+ ] ,
26+ plugins : [
27+ peerDepsExternal ( ) ,
28+ resolve ( ) ,
29+ commonjs ( ) ,
30+ typescript ( { tsconfig : './tsconfig.json' } ) ,
31+ terser ( ) ,
32+ postcss ( )
33+ ] ,
34+ external : [ 'react' , 'react-dom' ]
35+ } ,
36+ {
37+ input : 'src/index.ts' ,
38+ output : [ { file : packageJson . types } ] ,
39+ plugins : [ dts . default ( ) ] ,
40+ external : [ / \. c s s / ]
41+ }
42+ ]
You can’t perform that action at this time.
0 commit comments