-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot resolve module 'angular-multi-select' #95
Comments
I have no idea how Webpack works or what is required for this library to be compatible with Webpack. I'll research when I have some spare time. |
I think I had this problem too considering my source code says 'angular-multi-select/dist/prod/angular-multi-select' instead of 'angular-multi-select'. So let me explain the trick that I used: inside of the node_module folder you'll find an angular-multi-select folder if it's installed correctly. Normally, that would be enough. But I don't know which configuration file makes it work. However, I found a different solution after playing around a bit. While messing around, I discovered that webpack was perfectly happy with calling that folder in node_module a base folder! So with a bit of folder browsing, I figured out the path to the distributable starting from angular-multi-select...and voila: require('angular-multi-select/dist/prod/angular-multi-select')
The above should work. This is pointing at the unminimized source code. You can replace it with 'angular-multi-select/dist/prod/angular-multi-select.min' if you want to include the uglified version. I figure since webpack can be configured to uglify after the fact, it's perfectly fine using the uncompressed version. |
@TamaBaka 👍 Thank you very much for the long and interesting reply 😜 |
There was a problem confused me for a long time,when I use "npm install angular-multi-select",It's Ok,it lies in the node_modules folders sliently, but when I use webpack(1.13.0) to require("angular-multi-select") in ./app/jobModule/indexController.js,the problem came:
ERROR in ./app/jobModule/indexController.js
Module not found: Error: Cannot resolve module 'angular-multi-select' in D:\work\newbeehive\hive\src\app\jobModule
@ ./app/jobModule/indexController.js 17:4-35
and I don't konw what the wrong was,beacuse the other directives worked well here with the method I took. pls.
The text was updated successfully, but these errors were encountered: