javascript - Using bower modules with Webpack 2 - Stack Overflow

I am new to Webpack and I started with Webpack2. I can't manage to use require or import of module

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745390854a4625656.html

相关推荐

  • javascript - Using bower modules with Webpack 2 - Stack Overflow

    I am new to Webpack and I started with Webpack2. I can't manage to use require or import of module

    14小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信