New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

split-by-path-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split-by-path-webpack-plugin

Split a Webpack entry bundle into any number of arbitrarily defined smaller bundles

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
201
increased by23.31%
Maintainers
1
Weekly downloads
 
Created
Source

Split By Path Webpack Plugin

This plugin will split your entry bundle into any number of arbitrarily defined smaller bundles.

Credits

This plugin is based on split-by-name-webpack-plugin.

How?

Configuration of the plugin is simple. You instantiate the plugin with a single option: buckets which should be an array of objects, each containing the keys name and regex. Any modules which are in your entry chunk which match the bucket's regex (first matching bucket is used), are then moved to a new chunk with the given name.

Creating a 'catch-all' bucket is not necessary: anything which doesn't match one of the defined buckets will be left in the original chunk.

Example

var SplitByPathPlugin = require('split-by-path-webpack-plugin');
module.exports = {
  entry: {
    app: 'app.js'
  },
  output: {
    path: __dirname + '/dist',
    filename: "[name]-[chunkhash].js",
    chunkFilename: "[name]-[chunkhash].js"
  },
  plugins: [
    new SplitByNamePlugin({
      buckets: [{
        name: 'vendor',
        regex: /(node_modules\/|src\/vendor\/)/
      }]
    })
  ]
};

Keywords

FAQs

Package last updated on 16 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc