File tree Expand file tree Collapse file tree
packages/react-server/core/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 207207 global_defaults [ _AlwaysPreserveOrder ] = false ;
208208 global_defaults [ _AllowDuplicates ] = false ;
209209 global_defaults [ _CacheBust ] = false ;
210- /*!START_DEBUG*/ global_defaults [ _Debug ] = false ; /*!END_DEBUG*/
210+ /*!START_DEBUG*/ global_defaults [ _Debug ] = true ; /*!END_DEBUG*/
211211 global_defaults [ _BasePath ] = "" ;
212212
213213 // execute a script that has been preloaded already
Original file line number Diff line number Diff line change 11var lab = require ( "fs" ) . readFileSync ( __dirname + "/LAB.src.js" , "utf-8" ) ;
22
3- lab = require ( "uglify-js" ) . minify ( lab , { fromString : true } ) . code ;
3+ // Don't need this.
4+ lab = lab . replace ( / ^ " u s e s t r i c t " ; / , "" ) ;
5+
6+ // Run with `DEBUG_LAB=true` to see its output in console.log.
7+ if ( ! process . env . DEBUG_LAB ) {
8+
9+ // This is exactly what @getify does to remove debug code.
10+ // https://github.com/getify/LABjs/blob/master/BUILD.md
11+ lab = lab . replace ( / \/ \* ! S T A R T _ D E B U G (?: .| [ \n \r ] ) * ?E N D _ D E B U G \* \/ / g, "" ) ;
12+
13+ // After the debug code is removed just uglify.
14+ lab = require ( "uglify-js" ) . minify ( lab , { fromString : true } ) . code ;
15+ }
416
517module . exports = `
618/*! LAB.js (LABjs :: Loading And Blocking JavaScript)
You can’t perform that action at this time.
0 commit comments