Skip to content

Commit

Permalink
add :trusted-strings true closure compiler option
Browse files Browse the repository at this point in the history
this defaults to false for good reason, but for most code this
is actually unnecessary and confuses tools like tailwind jit.

for safety the closure compiler changes = to \x3d and <> chars.
basically everything that may lead to some XSS attack vector.
  • Loading branch information
thheller committed Nov 9, 2022
1 parent 0c97e81 commit 5cf0ea0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/shadow/build/closure.clj
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@
:all VariableRenamingPolicy/ALL
(throw (ex-info "invalid :variable-renaming (use :off, :local or :all)" {})))))

(when (true? (:trusted-strings opts))
(.setTrustedStrings closure-opts true))

(when (contains? opts :property-renaming)
(.setPropertyRenaming
closure-opts
Expand Down

0 comments on commit 5cf0ea0

Please sign in to comment.