最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Using bower modules with Webpack 2 - Stack Overflow

programmeradmin1浏览0评论

I am new to Webpack and I started with Webpack2. I can't manage to use require or import of modules from bower_ponents 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:

I am new to Webpack and I started with Webpack2. I can't manage to use require or import of modules from bower_ponents 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:

Share Improve this question asked Mar 11, 2017 at 16:39 Senad MetiljevicSenad Metiljevic 1551 silver badge8 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You can configure resolve.modules to also look in bower_ponents.

resolve: {
  modules: ['bower_ponents', 'node_modules']
}

This will first look into bower_ponents 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.

发布评论

评论列表(0)

  1. 暂无评论