0

with webpack ,we can build multiple entries just like below:

```
{
       entry:{
         'a':'a.js',
         'b':'b.js'
       },
       ...
       plugins:[
          new webpack.optimize.CommonsChunkPlugin({
            name:'vendor',
            minChunks:Infinity
            }),

       ]
    }
```

we can Generate an extra chunk, which contains common modules shared between entry points.when I have a lot entries,I just change the a.js,I only want to rebuild a.js,But the vendor.js and b.js should not change,how could I did this?

1 Answers1

0

You may want rewrite you config like this

```
{
       entry:{
         'a':'a.js',
         'b':'b.js'
       },
       ...
       plugins:[
          new webpack.optimize.CommonsChunkPlugin({
            name:'vendor'
            }),
          new webpack.optimize.CommonsChunkPlugin({
            name:'manifest',
            chunks: 'vendor',
            minChunks: Infinity
            }),

       ]
    }
```
VISHAL DAGA
  • 4,132
  • 10
  • 47
  • 53