# split-source-webpack-plugin

> webpack plugin for split lib from project

Latest version **0.1.1** (published 2019-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install split-source-webpack-plugin
pnpm add split-source-webpack-plugin
yarn add split-source-webpack-plugin
bun add split-source-webpack-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-11-03 |
| First published | 2018-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Henry Yang |
| Maintainers | henryyong |
| Keywords | split, source, webpack, plugin |

## Links

- npm: https://www.npmjs.com/package/split-source-webpack-plugin
- Repository: https://github.com/HenryYong/split-source-webpack-plugin
- Homepage: https://github.com/HenryYong/split-source-webpack-plugin#readme
- Issues: https://github.com/HenryYong/split-source-webpack-plugin/issues
- npm.io page: https://npm.io/package/split-source-webpack-plugin

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2019-11-03
- 0.1.0 — 2018-07-19

## README

# split-source-webpack-plugin

[简体中文](./README-zh.md)

This is a [webpack](https://github.com/webpack/webpack) plugin which is also based on [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin). It is used to split lib code from your project. The difference between this plugin and [dll](https://webpack.js.org/plugins/dll-plugin/) is that dll will bundle the lib code to one `js` file (This file will also be very big sometime), and this plugin can split lib code to different `script` tag. This plugin can save project users' time on production environment.

## Install

```bash
npm install split-source-webpack-plugin --save-dev
```

## Usage

```javascript
var HTMLWebpackPlugin = require('html-webpack-plugin')
var SplitSourceWebpackPlugin = require('split-source-webpack-plugin')

module.exports = {
  ...
  plugins: [
    new HTMLWebpackPlugin(),
    new SplitSourceWebpackPlugin([
      {
        libName: 'xx',
        globalName: 'yy',
        url: 'http://www.host.com/lib/name/${version}'
      }
    ])
  ]
}
```

## Options

|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|[libName](#)|`{String}`|''|The name of library which is used in project. For example, if `Vue` is required in project: `var Vue = require('vue')`, then libName should be set as `vue`|
|[globalName](#)|`{String}`|''|The name of library under global environment. For example, if `Vue` is required in project: `var Vue = require('vue')`, then globalName should be set as `Vue`|
|[url](#)|`{String}`|''|The source address of library. It can be local address or `CDN` address. Also, you can use `${version}` to tell the plugin to extract version info in `package.json` automatically|

---
_Source: https://npm.io/package/split-source-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
