Skip to content

Commit

Permalink
fix :js-options :resolve package to false
Browse files Browse the repository at this point in the history
prevents a npm require from being included in the package and was
previously broken due to a bad `or` use
  • Loading branch information
thheller committed Sep 20, 2018
1 parent f6694aa commit a61eea6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/shadow/build/npm.clj
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"zlib" "browserify-zlib"})

(def empty-rc
(let [ns 'shadow.empty]
(let [ns 'shadow$empty]
{:resource-id [::empty "shadow$empty.js"]
:resource-name "shadow$empty.js"
:output-name "shadow$empty.js"
Expand Down
8 changes: 6 additions & 2 deletions src/main/shadow/build/resolve.clj
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@
;; "./something.js" would override anything from any package
;; just assume ppl will only override packages for now
(let [resolve-cfg
(or (get-in require-ctx [:resolve require])
(get global-resolve-config require))]
(let [x (get-in require-ctx [:resolve require])]
;; can't use `or` since `false` is a legal return
(if-not (nil? x)
x
(get global-resolve-config require)
))]

(if (false? resolve-cfg)
npm/empty-rc
Expand Down

0 comments on commit a61eea6

Please sign in to comment.