bower-webpack-plugin
bower-webpack-plugin copied to clipboard
Cannot resolve 'file' or 'directory' ./dist/debug.js
Something wrong when i require 'Swiper' from bower
I have the same issue even if i try to only install the plugin and not to require any components. I'm wondering if this could be related to the fact that debug.js
is located in the ../debug
folder and not inside any dist
folder. How do we fix that?
UPDATE: I can confirm that if I manually create the dist
folder, the error disappears.
+1
Same problem.
Are you sure webpack should be looking in 'node_modules'? Did you manually rename your bower directory to that?
I have the same problem. I made manually the dist folder but it doesn't resolve the problem
See final comment of https://github.com/visionmedia/debug/issues/242 for working fix
@jlsutherland there is not a nice solution if you want to install packages with npm/yarn but this packages actually just a Bower packages without any module system (like angular-bootstrap-toggle).
I solved the issue in the following quick and ugly way (add to Webpack config):
externals: [
(context, request, callback) => {
if (request == 'debug')
callback(null, 'function(namespace) { return namespace; }');
else callback();
}
]
It just replaces debug module with empty function. It will not work if you need working debug module.