@@ -158,11 +158,11 @@ in rec {
158 obelisk-asset-manifest-generate "$src" "$haskellManifest" ${packageName} ${moduleName} "$symlinked"
158 obelisk-asset-manifest-generate "$src" "$haskellManifest" ${packageName} ${moduleName} "$symlinked"
161− compressedJs = frontend: pkgs.runCommand "compressedJs" { buildInputs = [ pkgs.closurecompiler ]; } ''
161+ compressedJs = frontend: optimizationLevel: pkgs.runCommand "compressedJs" { buildInputs = [ pkgs.closurecompiler ]; } ''
162 mkdir $out
162 mkdir $out
164 ln -s "${haskellLib.justStaticExecutables frontend}/bin/frontend.jsexe/all.js" all.unminified.js
164 ln -s "${haskellLib.justStaticExecutables frontend}/bin/frontend.jsexe/all.js" all.unminified.js
165− closure-compiler --externs "${reflex-platform.ghcjsExternsJs}" -O ADVANCED --jscomp_warning=checkVars --create_source_map="all.js.map" --source_map_format=V3 --js_output_file="all.js" all.unminified.js
165+ closure-compiler --externs "${reflex-platform.ghcjsExternsJs}" -O ${optimizationLevel} --jscomp_warning=checkVars --create_source_map="all.js.map" --source_map_format=V3 --js_output_file="all.js" all.unminified.js
166 echo "//# sourceMappingURL=all.js.map" >> all.js
166 echo "//# sourceMappingURL=all.js.map" >> all.js
@@ -233,14 +233,14 @@ in rec {
236− serverExe = backend: frontend: assets: config:
236+ serverExe = backend: frontend: assets: config: optimizationLevel:
237 pkgs.runCommand "serverExe" {} ''
237 pkgs.runCommand "serverExe" {} ''
238 mkdir $out
238 mkdir $out
240 ln -s "${haskellLib.justStaticExecutables backend}"/bin/* $out/
240 ln -s "${haskellLib.justStaticExecutables backend}"/bin/* $out/
241 ln -s "${mkAssets assets}" $out/static.assets
241 ln -s "${mkAssets assets}" $out/static.assets
242 cp -r ${config} $out/config
242 cp -r ${config} $out/config
243− ln -s ${mkAssets (compressedJs frontend)} $out/frontend.jsexe.assets
243+ ln -s ${mkAssets (compressedJs frontend optimizationLevel)} $out/frontend.jsexe.assets
246 server = { exe, hostName, adminEmail, routeHost, enableHttps, config }@args:
246 server = { exe, hostName, adminEmail, routeHost, enableHttps, config }@args:
@@ -269,6 +269,7 @@ in rec {
269 , tools ? _: []
269 , tools ? _: []
270 , shellToolOverrides ? _: _: {}
270 , shellToolOverrides ? _: _: {}
271 , withHoogle ? false # Setting this to `true` makes shell reloading far slower
271 , withHoogle ? false # Setting this to `true` makes shell reloading far slower
272+ , __closureCompilerOptimizationLevel ? "ADVANCED"
273 let frontendName = "frontend";
274 let frontendName = "frontend";
274 backendName = "backend";
275 backendName = "backend";
@@ -325,10 +326,10 @@ in rec {
325 nixpkgs.obeliskExecutableConfig.platforms.ios.inject injectableConfig processedStatic.symlinked;
326 nixpkgs.obeliskExecutableConfig.platforms.ios.inject injectableConfig processedStatic.symlinked;
326 } // ios;
327 } // ios;
328− passthru = { inherit android ios packages overrides tools shellToolOverrides withHoogle staticFiles; };
329+ passthru = { inherit android ios packages overrides tools shellToolOverrides withHoogle staticFiles __closureCompilerOptimizationLevel; };
330 in mkProject (projectDefinition args));
331 in mkProject (projectDefinition args));
331− serverOn = sys: config: serverExe (projectOut sys).ghc.backend (projectOut system).ghcjs.frontend (projectOut sys).passthru.staticFiles config;
332+ serverOn = sys: config: serverExe (projectOut sys).ghc.backend (projectOut system).ghcjs.frontend (projectOut sys).passthru.staticFiles config (projectOut sys).passthru.__closureCompilerOptimizationLevel;
332 linuxExe = serverOn "x86_64-linux";
333 linuxExe = serverOn "x86_64-linux";
333 in projectOut system // {
334 in projectOut system // {
334 linuxExeConfigurable = linuxExe;
335 linuxExeConfigurable = linuxExe;