Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack build very slow because of external libraries

I try use webpack to my app, but it build my app for 60-100sec each time. How can i disable rebuild files from node_modules/* and bower_components/* or build them for separate chunk (per module or shared).

here is part of config:

 {
    test: /\.js$/,
    exclude: /(node_modules|bower_components)/,
    loaders: ['ng-annotate', 'babel-loader']
 },

and

resolve: {
    moduleDirectories: ['node_modules', 'bower_components']
},

How can i improve performance, by disabling rebuilding of libraries at each time?

like image 478
ubombi Avatar asked Oct 25 '15 16:10

ubombi


1 Answers

We need to bundle vendor scripts separately. See this answer (stackoverflow)

like image 175
ubombi Avatar answered Sep 20 '22 14:09

ubombi