bower
Usage With Bower
To use components from bower you need to add two things to webpack:
- Let webpack look in the
bower_components
folder. - Let webpack use the
main
field from thebower.json
file.
Configuration
See configuration resolve.modulesDirectories
and list of plugins ResolverPlugin
.
var path = require("path"); var webpack = require("webpack"); module.exports = { resolve: { modulesDirectories: ["web_modules", "node_modules", "bower_components"] }, plugins: [ new webpack.ResolverPlugin( new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(".bower.json", ["main"]) ) ] }