Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tuchk4/webpack-code-splitter

Webpack code splitter (by file system paths,no matter where module was imported)
https://github.com/tuchk4/webpack-code-splitter

Last synced: 20 days ago
JSON representation

Webpack code splitter (by file system paths,no matter where module was imported)

Awesome Lists containing this project

README

        

# Webpack code splitter plugin

## Install

`npm install --save webpack-code-splitter`

```js
import WebpackCodeSplitter from 'webpack-code-splitter';

let webpackCodeSplitterPlugin = new WebpackCodeSplitter([
// every module from node_module or bower_components will be placed into js/vendor.js output build script
{
name: 'js/vendor',
path: ['node_modules/', 'bower_components/'],
},
// for bootstrap module - will be separated build script
{
name: 'js/bootstrap',
path: '\/bootstrap\\.js'
},
// all jade and html template will be placed into js/templates.js output build scirpt
{
name: 'js/templates',
path: '.+\\.(jade|html)'
}
]);

webpack.config.plugins.push(webpackCodeSplitterPlugin);
```