@@ -53,8 +53,14 @@ define(function (require, exports, module) {
5353 console . error ( `Script name ${ scriptFunctionName } should be a valid function name.` ) ;
5454 return false ;
5555 }
56- scriptText = `(function ${ scriptFunctionName } (){${ scriptText } })();` ;
57- scriptText = `eval(${ JSON . stringify ( scriptText ) } );` ;
56+ if ( Phoenix . config . environment !== "dev" ) {
57+ // obfuscate run time environment for private code to be less debug friendly
58+ scriptText = `(function (){${ scriptText } })();` ;
59+ scriptText = `eval(${ JSON . stringify ( scriptText ) } );` ;
60+ } else {
61+ // only dev builds have plain code
62+ scriptText = `(function ${ scriptFunctionName } (){${ scriptText } })();` ;
63+ }
5864 remoteFunctionsScripts . set ( scriptFunctionName , scriptText ) ;
5965 if ( ! RemoteFunctions . includes ( "// DONT_STRIP_MINIFY:REPLACE_WITH_ADDED_REMOTE_SCRIPTS" ) ) {
6066 throw new Error ( "RemoteFunctions script is missing the placeholder // REPLACE_WITH_ADDED_REMOTE_SCRIPTS" ) ;
@@ -78,6 +84,10 @@ define(function (require, exports, module) {
7884 LiveDevProtocol . setCustomRemoteFunctionProvider ( ( ) => {
7985 const effectiveScript = "window._LD=(" + effectiveRemoteFunctionsScripts +
8086 "(" + JSON . stringify ( LiveDevMultiBrowser . getConfig ( ) ) + "))" ;
87+ if ( Phoenix . config . environment === "dev" ) {
88+ return effectiveScript ;
89+ }
90+ // obfuscate run time environment for private code to be less debug friendly
8191 return `eval(${ JSON . stringify ( effectiveScript ) } )` ;
8292 } ) ;
8393
0 commit comments