@@ -158,11 +158,11 @@ in rec {
158158 obelisk-asset-manifest-generate "$src" "$haskellManifest" ${packageName} ${moduleName} "$symlinked"
159159 '';
160160
161− compressedJs = frontend: pkgs.runCommand "compressedJs" { buildInputs = [ pkgs.closurecompiler ]; } ''
161+ compressedJs = frontend: optimizationLevel: pkgs.runCommand "compressedJs" { buildInputs = [ pkgs.closurecompiler ]; } ''
162162 mkdir $out
163163 cd $out
164164 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
166166 echo "//# sourceMappingURL=all.js.map" >> all.js
167167 '';
168168
@@ -233,14 +233,14 @@ in rec {
233233 };
234234 };
235235
236− serverExe = backend: frontend: assets: config:
236+ serverExe = backend: frontend: assets: config: optimizationLevel:
237237 pkgs.runCommand "serverExe" {} ''
238238 mkdir $out
239239 set -eux
240240 ln -s "${haskellLib.justStaticExecutables backend}"/bin/* $out/
241241 ln -s "${mkAssets assets}" $out/static.assets
242242 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
244244 '';
245245
246246 server = { exe, hostName, adminEmail, routeHost, enableHttps, config }@args:
@@ -269,6 +269,7 @@ in rec {
269269 , tools ? _: []
270270 , shellToolOverrides ? _: _: {}
271271 , withHoogle ? false # Setting this to `true` makes shell reloading far slower
272+ , __closureCompilerOptimizationLevel ? "ADVANCED"
272273 }:
273274 let frontendName = "frontend";
274275 backendName = "backend";
@@ -325,10 +326,10 @@ in rec {
325326 nixpkgs.obeliskExecutableConfig.platforms.ios.inject injectableConfig processedStatic.symlinked;
326327 } // ios;
327328 };
328− passthru = { inherit android ios packages overrides tools shellToolOverrides withHoogle staticFiles; };
329+ passthru = { inherit android ios packages overrides tools shellToolOverrides withHoogle staticFiles __closureCompilerOptimizationLevel; };
329330 };
330331 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;
332333 linuxExe = serverOn "x86_64-linux";
333334 in projectOut system // {
334335 linuxExeConfigurable = linuxExe;