File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 17
17
},
18
18
"scripts" : {
19
19
"build" : " skpm-build" ,
20
- "watch" : " skpm-build --watch" ,
21
- "start" : " skpm-build --watch --run" ,
20
+ "watch" : " export DEBUG=1; skpm-build --watch" ,
21
+ "start" : " export DEBUG=1; skpm-build --watch --run" ,
22
22
"postinstall" : " npm run build && skpm-link"
23
23
},
24
24
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
+ let fs = require ( 'fs' ) ;
2
3
let path = require ( 'path' ) ;
4
+ let process = require ( 'process' ) ;
3
5
/**
4
6
* Function that mutates original webpack config.
5
7
* Supports asynchronous changes when promise is returned.
@@ -10,6 +12,17 @@ let path = require('path');
10
12
module . exports = function ( config , isPluginCommand ) {
11
13
/** you can change config here **/
12
14
if ( ! isPluginCommand ) return ;
15
+ let debug = ! ! process . env . DEBUG ;
16
+ if ( ! debug ) {
17
+ let dir = 'sketch-meaxure.sketchplugin/Contents/Sketch' ;
18
+ fs . readdirSync ( dir ) . forEach ( file => {
19
+ if ( file . endsWith ( '.js.map' ) ) {
20
+ console . log ( 'remove js map file' , file ) ;
21
+ fs . unlinkSync ( path . resolve ( dir , file ) ) ;
22
+ }
23
+ } )
24
+ }
25
+ config . mode = debug ? 'development' : 'production' ;
13
26
config . entry = {
14
27
mark : './src/index.ts' ,
15
28
} ;
You can’t perform that action at this time.
0 commit comments