我有:
$ 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和
@JSImport("node_modules/bootstrap/dist/js/bootstrap.min.js", "jQuery")然而,当我运行bundler时,我得到了以下错误:
[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)我还尝试只使用@JSImport的文件名bootstrap.min.js。(注意:我认为,一旦我解决了这个问题,我仍然有处理猴子修补的问题,因为这似乎就是bootstrap对JQuery所做的事情。)
发布于 2017-12-22 06:00:07
删除路径中的node_modules部件:
@JSImport("bootstrap/dist/js/bootstrap.min.js", "jQuery")还要确保此文件与CommonJS兼容。
https://stackoverflow.com/questions/47925492
复制相似问题