default install directory target.value / "scalajs-bundler-jsdom" does not exists, and
any its ancestor directory has one of:
node_modules directory (even if it's empty)
package.json file
This behavior unexpectedly edits other file which is not related to Scala project. Also, simultaneous installJsdom execution from sbt projects sometimes fails due to writing same node_modules directory.
For a workaround, I'm thinking about overriding installJsdom task.
Reproducing steps
Prepare sbt project with following files
Run npm init -y to create empty package.json
Run sbt test
... then I expected there is no node_modules directory in the root directory, but it exists
installJsdom
seems to install jsdom intotarget.value / "scalajs-bundler-jsdom"
. https://github.com/scalacenter/scalajs-bundler/blob/716c9213b339f97dc384404cb4e269656965a83e/sbt-scalajs-bundler/src/main/scala/scalajsbundler/sbtplugin/ScalaJSBundlerPlugin.scala#L606-L608However, it may install into other directory if:
target.value / "scalajs-bundler-jsdom"
does not exists, andnode_modules
directory (even if it's empty)package.json
fileThis behavior unexpectedly edits other file which is not related to Scala project. Also, simultaneous
installJsdom
execution from sbt projects sometimes fails due to writing same node_modules directory.For a workaround, I'm thinking about overriding installJsdom task.
Reproducing steps
npm init -y
to create empty package.jsonsbt test
/project/plugins.sbt
/build.sbt