File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 9
9
},
10
10
"scripts" : {
11
11
"clean" : " rimraf dist" ,
12
- "build" : " yarn clean && webpack --mode=production --host=production" ,
12
+ "build" : " yarn clean && webpack --mode=production --host=production && yarn prepublish" ,
13
+ "prepublish" : " node scripts/prepublish.js" ,
13
14
"build:staging" : " yarn clean && webpack --mode=production --host=staging" ,
14
15
"build:dev" : " webpack --mode=development --host=dev" ,
15
16
"watch" : " webpack --watch" ,
Original file line number Diff line number Diff line change
1
+ // before publishing update to figma, clean the dist forder for the size reduction.
2
+ // leave only dist/code.js and dist/ui.js under the dist folder (remove all other files)
3
+
4
+ const fs = require ( "fs" ) ;
5
+ const path = require ( "path" ) ;
6
+
7
+ const distPath = path . join ( __dirname , "../dist" ) ;
8
+
9
+ fs . readdirSync ( distPath ) . forEach ( ( file ) => {
10
+ if ( file !== "code.js" && file !== "ui.js" ) {
11
+ fs . unlink ( path . join ( distPath , file ) , ( err ) => {
12
+ if ( err ) throw err ;
13
+ } ) ;
14
+ }
15
+ } ) ;
You can’t perform that action at this time.
0 commit comments