Webpack build very slow because of external libraries

10,769

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

Share:
10,769
ubombi
Author by

ubombi

I hate ORMs

Updated on July 26, 2022

Comments

  • ubombi
    ubombi almost 2 years

    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?

  • Brian Cannard
    Brian Cannard over 7 years
    The links are broken now.
  • ubombi
    ubombi over 7 years
    Yep, semms like author remove those docs. Try search here survivejs.com/webpack/building-with-webpack
  • Brian Cannard
    Brian Cannard over 7 years
    Try to search those links on your behalf and please edit the answer here to prevent downvoting (trolls love doing that ;-) )