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 2323 "preprocess" : " node tasks/preprocess.js" ,
2424 "postinstall" : " npm run preprocess" ,
2525 "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" ,
2728 "cibuild" : " node tasks/cibundle.js" ,
2829 "watch" : " node tasks/watch_plotly.js" ,
2930 "lint" : " cd src && jshint . || true" ,
9091 "karma-firefox-launcher" : " ^0.1.6" ,
9192 "karma-jasmine" : " ^0.3.6" ,
9293 "open" : " 0.0.5" ,
94+ "prepend-file" : " ^1.3.0" ,
9395 "prettysize" : " 0.0.3" ,
9496 "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"
9799 }
98100}
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 11var fs = require ( 'fs' ) ;
22var path = require ( 'path' ) ;
33
4+ var pkg = require ( '../../package.json' ) ;
5+
46var pathToRoot = path . join ( __dirname , '../../' ) ;
57var pathToRootParent = path . join ( __dirname , '../../../../' ) ;
68var pathToSrc = path . join ( pathToRoot , 'src/' ) ;
@@ -61,5 +63,15 @@ module.exports = {
6163 beautify : false ,
6264 ascii_only : true
6365 }
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' )
6577} ;
You can’t perform that action at this time.
0 commit comments