Skip to content

Commit aa5b09b

Browse files
anmonteiroswannodette
authored andcommitted
CLJS-2246: Revert CLJS-2245 and CLJS-2240 and fix lein test
Revert "CLJS-2240: don't shell out to module_deps.js if `:npm-deps` not specified" This reverts commit efc7efa. Revert "CLJS-2245: Add support for using a local `node_modules` installation through a new `:node-modules` compiler flag" This reverts commit a0ed8c4.
1 parent a0ed8c4 commit aa5b09b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/main/clojure/cljs/closure.clj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@
23972397
- index all the node node modules
23982398
- process the JS modules (preprocess + convert to Closure JS)
23992399
- save js-dependency-index for compilation"
2400-
[{:keys [npm-deps node-modules target] :as opts} js-sources compiler-env]
2400+
[{:keys [npm-deps target] :as opts} js-sources compiler-env]
24012401
(let [;; Find all the top-level Node packages and their files
24022402
top-level (reduce
24032403
(fn [acc m]
@@ -2411,9 +2411,7 @@
24112411
(let [opts (-> opts
24122412
(update :foreign-libs
24132413
(fn [libs]
2414-
(into (if (or (not (empty? npm-deps)) (true? node-modules))
2415-
(index-node-modules node-required)
2416-
[])
2414+
(into (index-node-modules node-required)
24172415
(expand-libs libs))))
24182416
process-js-modules)]
24192417
(swap! compiler-env merge
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(ns node-modules-opt-test.core
2+
(:require left-pad))
3+
4+
(enable-console-print!)
5+
6+
(println "Padded:" (left-pad 42 5 0))

src/test/clojure/cljs/build_api_tests.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
(build/build (build/inputs (io/file inputs "data_readers_test")) opts cenv)
378378
(is (contains? (-> @cenv ::ana/data-readers) 'test/custom-identity))))
379379

380-
(deftest test-node-modules-cljs-2245
380+
(deftest test-node-modules-cljs-2246
381381
(test/delete-node-modules)
382382
(spit (io/file "package.json") (json/json-str {:dependencies {:left-pad "1.1.3"}
383383
:devDependencies {:module-deps "*"
@@ -390,7 +390,6 @@
390390
:opts {:main 'node-modules-opt-test.core
391391
:output-dir out
392392
:optimizations :none
393-
:node-modules true
394393
:closure-warnings {:check-types :off}}}
395394
cenv (env/default-compiler-env opts)]
396395
(test/delete-out-files out)

0 commit comments

Comments
 (0)