-
-
Save darwin/c75123726c56e965623eba07aa660e1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/shadow/build/closure.clj b/src/main/shadow/build/closure.clj | |
index 362450be..2912b866 100644 | |
--- a/src/main/shadow/build/closure.clj | |
+++ b/src/main/shadow/build/closure.clj | |
@@ -23,7 +23,7 @@ | |
CommandLineRunner VariableMap SourceMapInput DiagnosticGroups | |
CheckLevel JSModule CompilerOptions$LanguageMode | |
Result ShadowAccess | |
- SourceMap$DetailLevel SourceMap$Format ClosureCodingConvention CompilationLevel AnonymousFunctionNamingPolicy DiagnosticGroup NodeTraversal StrictModeCheck VariableRenamingPolicy PropertyRenamingPolicy PhaseOptimizer) | |
+ SourceMap$DetailLevel SourceMap$Format ClosureCodingConvention CompilationLevel AnonymousFunctionNamingPolicy DiagnosticGroup NodeTraversal StrictModeCheck VariableRenamingPolicy PropertyRenamingPolicy PhaseOptimizer CompilerOptions$Reach) | |
(shadow.build.closure ReplaceCLJSConstants NodeEnvInlinePass ReplaceRequirePass PropertyCollector NodeStuffInlinePass FindSurvivingRequireCalls ClearUnassignedJsRequires) | |
(com.google.javascript.jscomp.deps ModuleLoader$ResolutionMode) | |
(java.nio.charset Charset) | |
@@ -136,6 +136,15 @@ | |
:mapped AnonymousFunctionNamingPolicy/MAPPED | |
(throw (IllegalArgumentException. (str "Invalid :anon-fn-naming-policy value " policy " - only :off, :unmapped, :mapped permitted"))))))) | |
+ (when (contains? opts :remove-unused-variables) | |
+ (let [policy (:remove-unused-variables opts) | |
+ reach (case policy | |
+ :none CompilerOptions$Reach/NONE | |
+ :local-only CompilerOptions$Reach/LOCAL_ONLY | |
+ :all CompilerOptions$Reach/ALL | |
+ (throw (IllegalArgumentException. (str "Invalid :remove-unused-variables value " policy " - only :none, :local-only, :all permitted"))))] | |
+ (.setRemoveUnusedVariables closure-opts reach))) | |
+ | |
(when-let [lang-key (:language-in opts)] | |
(.setLanguageIn closure-opts (lang-key->lang-mode lang-key))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment