Skip to content

fix: preserve per-build :js-options in merged-shadow-config#18

Merged
plexus merged 2 commits intolambdaisland:mainfrom
ovistoica:main
Mar 4, 2026
Merged

fix: preserve per-build :js-options in merged-shadow-config#18
plexus merged 2 commits intolambdaisland:mainfrom
ovistoica:main

Conversation

@ovistoica
Copy link
Copy Markdown
Contributor

merged-shadow-config unconditionally replaces each build's :js-options with
{} for the root project or {:js-package-dirs [...]} for submodules. This
wipes out any per-build :js-options defined in shadow-cljs.edn.

This breaks projects that use :js-provider :external with :external-index,
because shadow-cljs never sees those options and falls back to the default
:shadow provider — silently skipping generation of the external index file.

Fix

  • Root project: Don't touch :js-options at all (there's nothing to add)
  • Submodules: merge into existing :js-options instead of replacing,
    so :js-package-dirs is added while preserving existing keys

Before

:js-options (if (= "" module-path)
              {}
              {:js-package-dirs [(str module-path "/node_modules")]})

After

(cond-> ...
  (not= "" module-path)
  (update :js-options merge {:js-package-dirs [(str module-path "/node_modules")]}))

I also updated the CHANGELOG with the fix. Please let me know if anything else is needed. Thank you for this great project!

true
(assoc :build-id build-id)
(not= "" module-path)
(update :js-options merge {:js-package-dirs [(str module-path "/node_modules")]}))])))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nitpick that this could have been (update :js-options assoc :js-package-dirs ...). But PR looks good, thanks!

@plexus plexus merged commit 2094974 into lambdaisland:main Mar 4, 2026
@plexus
Copy link
Copy Markdown
Member

plexus commented Mar 4, 2026

Released in v0.48.215-alpha

[com.lambdaisland/launchpad "0.48.215-alpha"]                 ;; deps.edn
{com.lambdaisland/launchpad {:mvn/version "0.48.215-alpha"}}  ;; project.clj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants