I'm trying to use sbt-web and sbt-js-engine in particular to resolve my dependencies with npm instead of webjars.
My problem is that the dependencies are not copied in the target/web/public/main/lib
folder during the web-stage
task as it is the case using webjar.
I used the sample project from sbt-js-engine to make my tests. With this project, I expect to find the console-browserify
dependency from the package.json
file in the target/web/public/main/lib
folder, but it is not.
Maybe I'm completely misunderstanding something ?
I've had a similar problem myself when trying to pulling some test dependencies with npm. after a few hour searching for a solution I ended up just writing a task in my build.sbt to move the directories manually: (May not be the best solution but a work around)
lazy val copy_node_modules = taskKey[Unit]("Copys the node_module to the test target dir")
copy_node_modules := {
val node_modules = new File("node_modules")
val target = new File("target/web/public/main/public/lib/")
IO.copyDirectory(node_modules,target,true, true)
}
addCommandAlias("get_npm_deps", ";web-assets:jseNpmNodeModules;copy_node_modules")
then you can use "get_npm_deps" to pull in the npm based dependencies
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With