I am new to Webpack and I started with Webpack2. I can't manage to use require or import of modules from bower_components folder. Is it possible to do so and if it is can you provide me an example or something.
This is my webpack.config file:
You can configure resolve.modules
to also look in bower_components
.
resolve: {
modules: ['bower_components', 'node_modules']
}
This will first look into bower_components
and if it can't find the module it will look into node_modules
. If you don't inlcude node_modules
you won't be able to use packages installed from npm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With