I have:
$ ls -last /home/brandon/workspace/ced2ar/jsgen/target/scala-2.12/scalajs-bundler/main/node_modules/bootstrap/dist/js/bootstrap.min.js
40 -rw-r--r-- 1 brandon brandon 37045 Jul 25 2016 /home/brandon/workspace/ced2ar/jsgen/target/scala-2.12/scalajs-bundler/main/node_modules/bootstrap/dist/js/bootstrap.min.js
and
@JSImport("node_modules/bootstrap/dist/js/bootstrap.min.js", "jQuery")
Yet when I run bundler I get the following error:
[error] ModuleNotFoundError: Module not found: Error: Can't resolve 'node_modules/bootstrap/dist/js/bootstrap.min.js' in '/home/brandon/workspace/ced2ar/jsgen/target/scala-2.12/scalajs-bundler/main'
[error] at factoryCallback (/home/brandon/workspace/ced2ar/jsgen/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/lib/Compilation.js:269:40)
I also tried just using the filename bootstrap.min.js
for @JSImport
. (Note: I figure that once I resolve this, I still have the issue of dealing with monkey patching, since that seems to be what bootstrap is doing to JQuery.)
Remove the
node_modules
part in your path:Be sure also that this file is CommonJS compatible.