File tree 4 files changed +201
-6
lines changed
4 files changed +201
-6
lines changed Original file line number Diff line number Diff line change 6
6
"scripts" : {
7
7
"example" : " webpack-dev-server --inline --mode development" ,
8
8
"build" : " rollup -c" ,
9
- "build:watch" : " rollup -c --watch"
9
+ "build:watch" : " rollup -c --watch" ,
10
+ "prebuild" : " rm -rf dist"
10
11
},
11
12
"keywords" : [
12
13
" reactjs" ,
59
60
"rollup" : " ^2.26.5" ,
60
61
"rollup-plugin-babel" : " ^4.4.0" ,
61
62
"rollup-plugin-img" : " ^1.1.0" ,
63
+ "rollup-plugin-typescript2" : " ^0.27.2" ,
62
64
"typescript" : " ^4.0.2" ,
63
65
"webpack" : " ^4.44.1" ,
64
66
"webpack-cli" : " ^3.3.12" ,
Original file line number Diff line number Diff line change 1
1
import babel from "rollup-plugin-babel" ;
2
2
import image from "rollup-plugin-img" ;
3
+ import typescript from 'rollup-plugin-typescript2' ;
3
4
import pkg from "./package.json" ;
4
5
5
6
const external = id => ! id . startsWith ( "/" ) && ! id . startsWith ( "." ) ;
6
7
7
8
export default {
8
- input : "./ src/ImageSlider.jsx " ,
9
+ input : "src/index.ts " ,
9
10
output : {
10
11
file : pkg . main ,
11
- format : "cjs " ,
12
+ format : "esm " ,
12
13
} ,
13
14
plugins : [
14
15
babel ( { runtimeHelpers : true } ) ,
15
16
image ( { limit : 1000 } ) ,
17
+ typescript ( {
18
+ tsconfig : 'tsconfig.json' ,
19
+ tsconfigOverride : {
20
+ include : [ 'src/**/*' ] ,
21
+ exclude : [ 'node_modules' , 'example' ]
22
+ }
23
+ } )
16
24
] ,
17
25
external,
18
26
} ;
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