Skip to content

Commit

Permalink
Merge pull request docschina#366 from SimonLeeee/cn
Browse files Browse the repository at this point in the history
完成翻译 aggressive-splitting-plugin.md webpack#322
  • Loading branch information
dear-lizhihua authored Aug 30, 2017
2 parents 12420d1 + ba988c8 commit 0b6e3f5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/content/plugins/aggressive-splitting-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ contributors:
- pierreneter
---

The `AggressiveSplittingPlugin` can split bundles into smaller chunks, splitting every chunk until it reaches the specified `maxSize` configured in `options`. It groups modules together by folder structure.
`AggressiveSplittingPlugin` 可以将 bundle 拆分成更小的 chunk,直到各个 chunk 的大小达到 `option` 设置的 `maxSize`。它通过目录结构将模块组织在一起。

It records the split points in webpack records and tries to restore splitting in the same manner it started. This ensures that after changes to the application, the previous split points (and chunks) are reused as they are probably already in the client's cache. Therefore it's heavily recommended to use records.
它记录了在 webpack 记录里的分离点,并尝试按照它开始的方式还原分离。这确保了在更改应用程序后,旧的分离点(和 chunk)是可再使用的,因为它们可能早已在客户端的缓存中。因此强烈推荐使用记录。

Only chunks bigger than the specified `minSize` are stored in records. This ensures the chunks fill up as your application grows, instead of creating too many chunks for every change.
仅有在 chunk 超过规定的 `minSize` 时才会保存在记录里。可以确保 chunk 随着应用程序的增加而增加,而不是每次改变的时候创建很多的 chunk。

Chunks can be invalidated if a module changes. Modules from invalid chunks will go back into the module pool from which new chunks are created.
如果模块更改,chunk 可能会无效。无效 chunk 中的模块会回到模块池(module pool)中,会同时创建一个新的模块。

```js
new webpack.optimize.AggressiveSplittingPlugin(options)
```


## Options
## 选项

```js
{
minSize: 30000, //Byte, split point. Default: 30720
maxSize: 50000, //Byte, maxsize of per file. Default: 51200
chunkOverhead: 0, //Default: 0
entryChunkMultiplicator: 1, //Default: 1
minSize: 30000, // 字节,分割点。默认:30720
maxSize: 50000, // 字节,每个文件最大字节。默认:51200
chunkOverhead: 0, // 默认:0
entryChunkMultiplicator: 1, // 默认:1
}
```


## Examples
## 示例

[http2-aggressive-splitting](https://github.com/webpack/webpack/tree/master/examples/http2-aggressive-splitting)

0 comments on commit 0b6e3f5

Please sign in to comment.