Skip to content

Commit ecb1796

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 7487929 commit ecb1796

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

default.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ in rec {
9393
ln -s "$dir/all.unminified.js" "$dir/all.js"
9494
'' else ''
9595
# NOTE: "--error_format JSON" avoids closurecompiler crashes when trying to report errors.
96-
'${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"
96+
'${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"
9797
echo '//# sourceMappingURL=all.js.map' >> "$dir/all.js"
9898
''}
9999
done
@@ -262,7 +262,9 @@ in rec {
262262
, shellToolOverrides ? _: _: {}
263263
, withHoogle ? false # Setting this to `true` makes shell reloading far slower
264264
, externjs ? null
265-
, __closureCompilerOptimizationLevel ? "ADVANCED" # Set this to `null` to skip the closure-compiler step
265+
# TODO: Need to figure if we can reset this to ADVANCED or figure out better compression via
266+
# https://blog.haskell.org/case-study-foreign-integration-js-browser/
267+
, __closureCompilerOptimizationLevel ? "SIMPLE" # Set this to `null` to skip the closure-compiler step
266268
, __withGhcide ? false
267269
, __deprecated ? {}
268270
}:

0 commit comments

Comments
 (0)