8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f8f08cf + cf4133d commit b854d61Copy full SHA for b854d61
package.json
@@ -54,6 +54,7 @@
54
"browserify": {
55
"transform": [
56
"glslify",
57
+ "./tasks/compress_headers.js",
58
"./tasks/compress_attributes.js"
59
]
60
},
tasks/compress_headers.js
@@ -0,0 +1,27 @@
1
+var through = require('through2');
2
+
3
+var licenseSrc = require('./util/constants').licenseSrc
4
+ .replace(/\//g, '\\/')
5
+ .replace(/\*/g, '\\*')
6
+ .replace(/\n/g, '[^]');
7
8
+/**
9
+ * Browserify transform that strips redundant plotly.js Copyright comments out
10
+ * of the plotly.js bundles
11
+ */
12
13
+var WHITESPACE_BEFORE = '\\s*';
14
15
+module.exports = function() {
16
+ var allChunks = [];
17
+ return through(function(chunk, enc, next) {
18
+ allChunks.push(chunk);
19
+ next();
20
+ }, function(done) {
21
+ var str = Buffer.concat(allChunks).toString('utf-8');
22
+ this.push(
23
+ str.replace(new RegExp(WHITESPACE_BEFORE + licenseSrc, 'g'), '')
24
+ );
25
+ done();
26
+ });
27
+};
0 commit comments