-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLJS-2450: Allow configuring ingnored JS module extensions
- Loading branch information
1 parent
8baeacd
commit f7d611d
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,7 +169,7 @@ | |
:fn-invoke-direct :checked-arrays :closure-module-roots :rewrite-polyfills :use-only-custom-externs | ||
:watch :watch-error-fn :watch-fn :install-deps :process-shim :rename-prefix :rename-prefix-namespace | ||
:closure-variable-map-in :closure-property-map-in :closure-variable-map-out :closure-property-map-out | ||
:stable-names}) | ||
:stable-names :ignore-js-module-exts}) | ||
|
||
(def string->charset | ||
{"iso-8859-1" StandardCharsets/ISO_8859_1 | ||
|
@@ -2183,7 +2183,10 @@ | |
{:closure-variable-map-in (io/file output-dir "closure_var.map") | ||
:closure-variable-map-out (io/file output-dir "closure_var.map") | ||
:closure-property-map-in (io/file output-dir "closure_prop.map") | ||
:closure-property-map-out (io/file output-dir "closure_prop.map")}))))) | ||
:closure-property-map-out (io/file output-dir "closure_prop.map")})) | ||
|
||
(nil? (:ignore-js-module-exts opts)) | ||
(assoc :ignore-js-module-exts [".css"])))) | ||
|
||
(defn- alive? [proc] | ||
(try (.exitValue proc) false (catch IllegalThreadStateException _ true))) | ||
|
@@ -2442,8 +2445,13 @@ | |
(map (fn [lib] | ||
(let [js (deps/load-foreign-library lib) | ||
url (str (deps/-url js opts))] | ||
(if (and url (not (or (.endsWith url ".js") (.endsWith url ".json")))) | ||
(assoc js :source "") | ||
(if (and url (some (fn [ext] | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Deraen
Author
Contributor
|
||
(.endsWith url ext)) | ||
(:ignore-js-module-exts opts))) | ||
(do | ||
(when (or ana/*verbose* (:verbose opts)) | ||
(util/debug-prn "Ignoring JS module" url "based on the file extension")) | ||
(assoc js :source "")) | ||
(assoc js :source (deps/-source js opts)))))) | ||
(map (fn [js] | ||
(if (:preprocess js) | ||
|
I think
url
will always be truthy, no?