How does webpack extract public packages?
高洛峰
高洛峰 2017-05-16 13:26:09
0
1
573
// ...
entry: {
    pageA: './src/pages/pageA.js',
    pageB: './src/pages/pageB.js',
    pageC: './src/pages/pageC.js',
    pageD: './src/pages/pageD.js',
    vendor: ['lodash', 'moment', 'marked'],
},
plugins: {
    new webpack.optimize.CommonsChunkPlugin({
        name: ['vendor', 'manifest'],
    })
}
// ...

According to the official webpack2 documentation, through the above configuration, the third-party library can be extracted to vendor.js. So how to extract the custom public packages used in pageA, pageB, pageC, and pageD?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
迷茫

/a/11...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template