File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 5454 "browserify" : {
5555 "transform" : [
5656 " glslify" ,
57+ " ./tasks/compress_headers.js" ,
5758 " ./tasks/compress_attributes.js"
5859 ]
5960 },
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