-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathheader_dist.js
31 lines (27 loc) · 1.04 KB
/
header_dist.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var prependFile = require('prepend-file');
var constants = require('./util/constants');
var common = require('./util/common');
(function addHeadersInDistFiles() {
function _prepend(path, header) {
prependFile(path, header + '\n', common.throwOnError);
}
// add header to main dist bundles
var pathsDist = [
constants.pathToPlotlyDistMin,
constants.pathToPlotlyDist,
constants.pathToPlotlyDistWithMeta,
constants.pathToPlotlyGeoAssetsDist
];
pathsDist.forEach(function(path) {
_prepend(path, constants.licenseDist);
});
// add header and bundle name to partial bundle
constants.partialBundlePaths.forEach(function(pathObj) {
var headerDist = constants.licenseDist
.replace('plotly.js', 'plotly.js (' + pathObj.name + ')');
_prepend(pathObj.dist, headerDist);
var headerDistMin = constants.licenseDist
.replace('plotly.js', 'plotly.js (' + pathObj.name + ' - minified)');
_prepend(pathObj.distMin, headerDistMin);
});
})();