File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 9
9
10
10
dist : bundle uglify
11
11
12
- versionTick :
12
+ version :
13
13
node ./tasks/version
14
-
15
- version : versionTick dist
14
+ make dist
16
15
git add -A dist js
Original file line number Diff line number Diff line change @@ -2,15 +2,16 @@ const fs = require('fs');
2
2
const execSync = require ( 'child_process' ) . execSync ;
3
3
4
4
// get file paths from index.js
5
- let indexSrc = fs . readFileSync ( './js/index.js' , 'utf8' ) ;
5
+ const indexPath = 'js/index.js' ;
6
+ let indexSrc = fs . readFileSync ( `./${ indexPath } ` , 'utf8' ) ;
6
7
let cjsBlockRegex = / m o d u l e \. e x p o r t s = f a c t o r y \( [ \w , ' \. \- \( \) \/ \n ] + ; / i;
7
8
let cjsBlockMatch = indexSrc . match ( cjsBlockRegex ) ;
8
9
let paths = cjsBlockMatch [ 0 ] . match ( / r e q u i r e \( ' ( [ \. \- \/ \w ] + ) ' \) / gi ) ;
9
10
10
11
paths = paths . map ( function ( path ) {
11
12
return path . replace ( `require('.` , 'js' ) . replace ( `')` , '.js' ) ;
12
13
} ) ;
13
- paths . push ( 'js/index.js' ) ;
14
+ paths . push ( indexPath ) ;
14
15
15
16
execSync ( `cat ${ paths . join ( ' ' ) } > dist/zdog.dist.js` ) ;
16
17
You can’t perform that action at this time.
0 commit comments