Skip to content

aretecode/webpack-split-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤸🔌 webpack-split-plugin

split bundle into multiple pieces with custom specifications

extension of CommonsChunkPlugin

output

📦 install

yarn add webpack-split-plugin --dev
npm i webpack-split-plugin --save-dev
const WebpackSplitPlugin = require('webpack-split-plugin')

// also exported for convenience
const {CollectionManager, custom, match, version, log} = WebpackSplitPlugin
plugins: [
  new WebpackSplitPlugin({
    // * required
    name: 'eh',
    filename: '[name]-split.js',

    // [optional], very verbose output
    debug: true,

    // [optional], automatically figures it out after first run
    totalSize: '1937kb', // 1.937mb
  }),
],
new WebpackSplitPlugin({
  debug: 'verbose',
  filename: '[name]-split.js',
  custom: custom.splits({
    // order of specificity
    eh: ['moment'],
    react: ['react'],
    moose: [/noop/],
    igloo: [file => (/plx/).test(file)],
    canada: ['src/*.js'],
  }),
})

About

custom, easier code splitting in webpack

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published