File tree Expand file tree Collapse file tree 4 files changed +78
-8
lines changed Expand file tree Collapse file tree 4 files changed +78
-8
lines changed Original file line number Diff line number Diff line change 3333 "scripts" : {
3434 "test" : " CI=true react-scripts test --env=jsdom || true" ,
3535 "test:watch" : " react-scripts test --env=jsdom" ,
36+ "prebuild" : " rm -rf dist" ,
3637 "build" : " rollup -c" ,
3738 "start" : " rollup -c -w" ,
3839 "prepare" : " npm run build" ,
7071 "rollup-plugin-commonjs" : " ^10.1.0" ,
7172 "rollup-plugin-node-resolve" : " ^5.2.0" ,
7273 "rollup-plugin-peer-deps-external" : " ^2.2.3" ,
74+ "rollup-plugin-terser" : " ^7.0.0" ,
7375 "rollup-plugin-typescript2" : " ^0.27.2" ,
7476 "standard-version" : " ^8.0.2" ,
7577 "typescript" : " ^3.9.7"
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import typescript from 'rollup-plugin-typescript2';
22import commonjs from 'rollup-plugin-commonjs' ;
33import external from 'rollup-plugin-peer-deps-external' ;
44import resolve from 'rollup-plugin-node-resolve' ;
5+ import { terser } from 'rollup-plugin-terser' ;
56
67import pkg from './package.json' ;
78
@@ -29,5 +30,6 @@ export default {
2930 clean : true ,
3031 } ) ,
3132 commonjs ( ) ,
33+ terser ( ) ,
3234 ] ,
3335} ;
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22
33type TScriptLoader = {
4- onCreate ?: ( ( ) => null ) | undefined ;
5- onLoad ?: ( ( ) => null ) | undefined ;
6- onError ?: ( ( e : any ) => never ) | undefined ;
7- delayMs ?: number | undefined ;
8- htmlPart ?: string | undefined ;
4+ onCreate ?: ( ) => null ;
5+ onLoad ?: ( ) => null ;
6+ onError ?: ( e : any ) => never ;
7+ delayMs ?: number ;
8+ htmlPart ?: string ;
99 src : string ;
10- otherProps ?: Record < string , unknown > | undefined ;
10+ otherProps ?: Record < string , unknown > ;
1111} ;
1212
1313type TAppendScript = {
1414 id : string ;
1515 scriptText : string ;
16- optionalCallback ?: ( ( ) => null ) | undefined ;
16+ optionalCallback ?: ( ) => null ;
1717 htmlPart : string ;
18- otherProps ?: Record < string , unknown > | undefined ;
18+ otherProps ?: Record < string , unknown > ;
1919} ;
2020
2121type TUseScript = {
You can’t perform that action at this time.
0 commit comments