Including Waypoints in Webpack config
config = { entry: { vendor: [ "jquery", "waypoints", "picturefill", "babel-polyfill" ] }, plugins: [ new webpack.ProvidePlugin({ $: "jquery", waypoints: "waypoints" }) ]
}
I am getting "Module not found: Error: Cannot resolve module 'waypoints'" How to get Waypoints in the vendor file?
The underlying problem here is being discussed over at #458.
As a workaround, I'm doing this to import waypoints in webpack: require('waypoints/lib/jquery.waypoints.js');
I'm new to webpack but I think your example will work if you add this to the config file:
resolve: {
alias: {
'waypoints': 'waypoints/lib/jquery.waypoints.js'
}
}
If you want to import a shortcut you have to do this instead:
resolve: {
alias: {
'waypoints': 'waypoints/lib'
}
}
Then you can import the shortcut or any other script for that mater like this:
require("waypoints/lib/jquery.waypoints.js");
require("waypoints/lib/shortcuts/sticky.js");
As a workaround until this is fully supported :)
So when will this actually get fully supported? It is a shame I have to deal with this by messy workarounds. Makes me want to stop using this.