Simple solution to share modules loaded via NPM across multiple Browserify or Webpack bundles

后端 未结 3 1158
Happy的楠姐
Happy的楠姐 2021-02-04 05:36

Pulling my hair out here looking for a simple solution to share code, required via NPM, across multiple Browserify or Webpack bundles. Thinking, is there such a thing

3条回答
  •  轮回少年
    2021-02-04 06:07

    // vendor anything coming from node_modules
    minChunks: module => /node_modules/.test(module.resource)
    

    Source: https://github.com/webpack/webpack/issues/2372#issuecomment-213149173

提交回复
热议问题