Skip to content

Commit 604875b

Browse files
committed
Adapt closure-compiler command and set to SIMPLE
Without language-in UNSTABLE throws error at compress time without SIMPLE throws error at runtime
1 parent 85f7a1b commit 604875b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

default.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ in rec {
9191
ln -s "$dir/all.unminified.js" "$dir/all.js"
9292
'' else ''
9393
# NOTE: "--error_format JSON" avoids closurecompiler crashes when trying to report errors.
94-
'${pkgs.closurecompiler}/bin/closure-compiler' --error_format JSON ${if externs == null then "" else "--externs '${externs}'"} --externs '${reflex-platform.ghcjsExternsJs}' -O '${optimizationLevel}' --jscomp_warning=checkVars --warning_level=QUIET --create_source_map="$dir/all.js.map" --source_map_format=V3 --js_output_file="$dir/all.js" "$dir/all.unminified.js"
94+
'${pkgs.closurecompiler}/bin/closure-compiler' --language_in UNSTABLE --error_format JSON ${if externs == null then "" else "--externs '${externs}'"} --externs '${reflex-platform.ghcjsExternsJs}' -O '${optimizationLevel}' --jscomp_warning=checkVars --warning_level=QUIET --create_source_map="$dir/all.js.map" --source_map_format=V3 --js_output_file="$dir/all.js" "$dir/all.unminified.js"
9595
echo '//# sourceMappingURL=all.js.map' >> "$dir/all.js"
9696
''}
9797
done
@@ -268,7 +268,9 @@ in rec {
268268
, shellToolOverrides ? _: _: {}
269269
, withHoogle ? false # Setting this to `true` makes shell reloading far slower
270270
, externjs ? null
271-
, __closureCompilerOptimizationLevel ? "ADVANCED" # Set this to `null` to skip the closure-compiler step
271+
# TODO: Need to figure if we can reset this to ADVANCED or figure out better compression via
272+
# https://blog.haskell.org/case-study-foreign-integration-js-browser/
273+
, __closureCompilerOptimizationLevel ? "SIMPLE" # Set this to `null` to skip the closure-compiler step
272274
, __withGhcide ? false
273275
, __deprecated ? {}
274276
}:

0 commit comments

Comments
 (0)