File tree Expand file tree Collapse file tree 3 files changed +39
-4
lines changed Expand file tree Collapse file tree 3 files changed +39
-4
lines changed Original file line number Diff line number Diff line change 23
23
"preprocess" : " node tasks/preprocess.js" ,
24
24
"postinstall" : " npm run preprocess" ,
25
25
"bundle" : " node tasks/bundle.js" ,
26
- "build" : " npm run preprocess && npm run bundle" ,
26
+ "header" : " node tasks/header.js" ,
27
+ "build" : " npm run preprocess && npm run bundle && npm run header" ,
27
28
"cibuild" : " node tasks/cibundle.js" ,
28
29
"watch" : " node tasks/watch_plotly.js" ,
29
30
"lint" : " cd src && jshint . || true" ,
90
91
"karma-firefox-launcher" : " ^0.1.6" ,
91
92
"karma-jasmine" : " ^0.3.6" ,
92
93
"open" : " 0.0.5" ,
94
+ "prepend-file" : " ^1.3.0" ,
93
95
"prettysize" : " 0.0.3" ,
94
96
"through2" : " ^2.0.0" ,
95
- "watchify " : " ^3.6 .0" ,
96
- "uglify-js " : " ^2.5 .0"
97
+ "uglify-js " : " ^2.5 .0" ,
98
+ "watchify " : " ^3.6 .0"
97
99
}
98
100
}
Original file line number Diff line number Diff line change
1
+ var prependFile = require ( 'prepend-file' ) ;
2
+
3
+ var constants = require ( './util/constants' ) ;
4
+
5
+
6
+ // add headers to dist files
7
+
8
+ var pathsDist = [
9
+ constants . pathToPlotlyDistMin ,
10
+ constants . pathToPlotlyDist ,
11
+ constants . pathToPlotlyDistWithMeta ,
12
+ constants . pathToPlotlyGeoAssetsDist
13
+ ] ;
14
+
15
+ function headerLicense ( path ) {
16
+ prependFile ( path , constants . licenseDist , function ( err ) {
17
+ if ( err ) throw err ;
18
+ } ) ;
19
+ }
20
+
21
+ pathsDist . forEach ( headerLicense ) ;
Original file line number Diff line number Diff line change 1
1
var fs = require ( 'fs' ) ;
2
2
var path = require ( 'path' ) ;
3
3
4
+ var pkg = require ( '../../package.json' ) ;
5
+
4
6
var pathToRoot = path . join ( __dirname , '../../' ) ;
5
7
var pathToRootParent = path . join ( __dirname , '../../../../' ) ;
6
8
var pathToSrc = path . join ( pathToRoot , 'src/' ) ;
@@ -61,5 +63,15 @@ module.exports = {
61
63
beautify : false ,
62
64
ascii_only : true
63
65
}
64
- }
66
+ } ,
67
+
68
+ licenseDist : [
69
+ '/**' ,
70
+ '* plotly.js v' + pkg . version ,
71
+ '* Copyright 2012-2015, Plotly, Inc.' ,
72
+ '* All rights reserved.' ,
73
+ '* Licensed under the MIT license' ,
74
+ '*/' ,
75
+ ''
76
+ ] . join ( '\n' )
65
77
} ;
You can’t perform that action at this time.
0 commit comments