File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 54
54
"browserify" : {
55
55
"transform" : [
56
56
" glslify" ,
57
+ " ./tasks/compress_headers.js" ,
57
58
" ./tasks/compress_attributes.js"
58
59
]
59
60
},
Original file line number Diff line number Diff line change
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
+ } ;
You can’t perform that action at this time.
0 commit comments