File tree Expand file tree Collapse file tree 4 files changed +201
-6
lines changed Expand file tree Collapse file tree 4 files changed +201
-6
lines changed Original file line number Diff line number Diff line change 66 "scripts" : {
77 "example" : " webpack-dev-server --inline --mode development" ,
88 "build" : " rollup -c" ,
9- "build:watch" : " rollup -c --watch"
9+ "build:watch" : " rollup -c --watch" ,
10+ "prebuild" : " rm -rf dist"
1011 },
1112 "keywords" : [
1213 " reactjs" ,
5960 "rollup" : " ^2.26.5" ,
6061 "rollup-plugin-babel" : " ^4.4.0" ,
6162 "rollup-plugin-img" : " ^1.1.0" ,
63+ "rollup-plugin-typescript2" : " ^0.27.2" ,
6264 "typescript" : " ^4.0.2" ,
6365 "webpack" : " ^4.44.1" ,
6466 "webpack-cli" : " ^3.3.12" ,
Original file line number Diff line number Diff line change 11import babel from "rollup-plugin-babel" ;
22import image from "rollup-plugin-img" ;
3+ import typescript from 'rollup-plugin-typescript2' ;
34import pkg from "./package.json" ;
45
56const external = id => ! id . startsWith ( "/" ) && ! id . startsWith ( "." ) ;
67
78export default {
8- input : "./ src/ImageSlider.jsx " ,
9+ input : "src/index.ts " ,
910 output : {
1011 file : pkg . main ,
11- format : "cjs " ,
12+ format : "esm " ,
1213 } ,
1314 plugins : [
1415 babel ( { runtimeHelpers : true } ) ,
1516 image ( { limit : 1000 } ) ,
17+ typescript ( {
18+ tsconfig : 'tsconfig.json' ,
19+ tsconfigOverride : {
20+ include : [ 'src/**/*' ] ,
21+ exclude : [ 'node_modules' , 'example' ]
22+ }
23+ } )
1624 ] ,
1725 external,
1826} ;
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "declaration" : true ,
4+ "declarationDir" : " ./dist" ,
5+ "target" : " ESNext" ,
6+ "module" : " ESNext" ,
7+ "moduleResolution" : " node" ,
8+ "esModuleInterop" : true ,
9+ "sourceMap" : true ,
10+ "noImplicitAny" : true ,
11+ "noImplicitThis" : true ,
12+ "alwaysStrict" : true ,
13+ "strictNullChecks" : true ,
14+ "strictPropertyInitialization" : true ,
15+ "noImplicitReturns" : true ,
16+ "noUnusedParameters" : true ,
17+ "allowSyntheticDefaultImports" : true ,
18+
19+ "jsx" : " react" ,
20+ "types" : [" react" ],
21+ "outDir" : " dist"
22+ },
23+ "include" : [
24+ " src/**/*" ,
25+ " example/*"
26+ ],
27+ "exclude" : [
28+ " node_modules"
29+ ]
30+ }
You can’t perform that action at this time.
0 commit comments