Skip to content

Commit

Permalink
docs(webpack5): 更新 webpack5 文档
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxue committed Dec 13, 2019
1 parent c62ed0a commit c9b2f66
Show file tree
Hide file tree
Showing 37 changed files with 1,154 additions and 1,120 deletions.
19 changes: 10 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.0.6 (2019-12-12)
## 1.0.6 (2019-12-13)

### 🌟 新功能
范围|描述|commitId
Expand Down Expand Up @@ -60,14 +60,6 @@
scripts cz | 修改脚本cz命令 | [b4a8c51](https://github.com/luoxue-victor/learn_webpack/commit/b4a8c51)


范围|描述|commitId
--|--|--
Update README.md | [3ebdc06](https://github.com/luoxue-victor/learn_webpack/commit/3ebdc06)
Delete .DS_Store | [b9d18cd](https://github.com/luoxue-victor/learn_webpack/commit/b9d18cd)
dev,build 命令descreiption错误 | [b47f016](https://github.com/luoxue-victor/learn_webpack/commit/b47f016)
Initial commit | [18fbebf](https://github.com/luoxue-victor/learn_webpack/commit/18fbebf)


### 📝 文档
范围|描述|commitId
--|--|--
Expand All @@ -84,6 +76,7 @@
readme | 保存文档 | [99c82c1](https://github.com/luoxue-victor/learn_webpack/commit/99c82c1)
readme | 代码折叠默认展开 | [01e1ea8](https://github.com/luoxue-victor/learn_webpack/commit/01e1ea8)
readme | 添加readme 钩子 | [83d51b1](https://github.com/luoxue-victor/learn_webpack/commit/83d51b1)
readme | 文档增加 upgrade | [c62ed0a](https://github.com/luoxue-victor/learn_webpack/commit/c62ed0a)
readme | 新增ssr说明 | [18e152a](https://github.com/luoxue-victor/learn_webpack/commit/18e152a)
readme | 修改文档 | [8cd7443](https://github.com/luoxue-victor/learn_webpack/commit/8cd7443)
readme | 修改readme | [06b1b2f](https://github.com/luoxue-victor/learn_webpack/commit/06b1b2f)
Expand All @@ -92,3 +85,11 @@
stylelint | 课时11的文档完善 | [4a55f80](https://github.com/luoxue-victor/learn_webpack/commit/4a55f80)
version | v1.0.5 | [c2b5932](https://github.com/luoxue-victor/learn_webpack/commit/c2b5932)


范围|描述|commitId
--|--|--
Update README.md | [3ebdc06](https://github.com/luoxue-victor/learn_webpack/commit/3ebdc06)
Delete .DS_Store | [b9d18cd](https://github.com/luoxue-victor/learn_webpack/commit/b9d18cd)
dev,build 命令descreiption错误 | [b47f016](https://github.com/luoxue-victor/learn_webpack/commit/b47f016)
Initial commit | [18fbebf](https://github.com/luoxue-victor/learn_webpack/commit/18fbebf)

26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
<br/>


- [课题01:初探 webpack](./docs/课时-01.md)
- [课题02:搭建可插拔的开发环境跟生产环境](./docs/课时-02.md)
- [课题03:基础配置(loder,ts、babel、css、less、sass、postcss)等](./docs/课时-03.md)
- [课题04:webpack 性能优化1](./docs/课时-04.md)
- [课题05: 手写一个loader,实现可选链](./docs/课时-05.md)
- [课题06:webpack编译优化](./docs/课时-06.md)
- [课题07:多页面配置](./docs/课时-07.md)
- [课题08:手写一个 webpack plugin](./docs/课时-08.md)
- [课题09:webpack 构建 ssr](./docs/课时-09.md)
- [课题10:添加 eslint 并开启自动修复](./docs/课时-10.md)
- [课题11:添加 stylelint](./docs/课时-11.md)
- [课题12:添加 tslint](./docs/课时-12.md)
- [课题13:配置别名](./docs/课时-13.md)
- [课题 01:初探 webpack](./docs/课时-01.md)
- [课题 02:搭建可插拔的开发环境跟生产环境](./docs/课时-02.md)
- [课题 03:基础配置(loder,ts、babel、css、less、sass、postcss)等](./docs/课时-03.md)
- [课题 04:webpack 性能优化 1](./docs/课时-04.md)
- [课题 05: 手写一个 loader,实现可选链](./docs/课时-05.md)
- [课题 06:webpack 编译优化](./docs/课时-06.md)
- [课题 07:多页面配置](./docs/课时-07.md)
- [课题 08:手写一个 webpack plugin](./docs/课时-08.md)
- [课题 09:webpack 构建 ssr](./docs/课时-09.md)
- [课题 10:添加 eslint 并开启自动修复](./docs/课时-10.md)
- [课题 11:添加 stylelint](./docs/课时-11.md)
- [课题 12:添加 tslint](./docs/课时-12.md)
- [课题 13:配置别名](./docs/课时-13.md)
- [课时 14: 升级 webpack5](./docs/课时-14.md)

</details>
Expand Down
4 changes: 4 additions & 0 deletions config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = ({ config, resolve, options }) => {
// 入口路径
.add(resolve(entry))
.end()
.cache({
type: 'filesystem'
})
// 模式 "production" | "development" | "none"
// .mode(process.env.NODE_ENV) 等价下面
.set('mode', 'development') // process.env.NODE_ENV
Expand All @@ -24,6 +27,7 @@ module.exports = ({ config, resolve, options }) => {
.path(resolve(output))
.filename('[name].bundle.js')
.publicPath(publicPath)
.set('ecmaVersion', 6)

config.devtool('cheap-source-map')
}
Expand Down
8 changes: 7 additions & 1 deletion config/optimization.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ module.exports = ({ config }) => {
config
.optimization.splitChunks({
chunks: 'async',
minSize: 30000,
// webpack5
// https://github.com/webpack/changelog-v5#splitchunks-and-module-sizes
minSize: {
javascript: 30000,
style: 50000
},
minChunks: 1,
maxAsyncRequests: 3,
maxInitialRequests: 3,
Expand All @@ -25,5 +30,6 @@ module.exports = ({ config }) => {
}
})
config.optimization.usedExports(true)
// config.optimization.set('chunkIds', 'natural')
}
}
55 changes: 0 additions & 55 deletions dist/index/0.bundle.js

This file was deleted.

Binary file removed dist/index/0.bundle.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion dist/index/0.bundle.js.map

This file was deleted.

16 changes: 0 additions & 16 deletions dist/index/1.bundle.js

This file was deleted.

Binary file removed dist/index/1.bundle.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion dist/index/1.bundle.js.map

This file was deleted.

12 changes: 0 additions & 12 deletions dist/index/1.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/index/1.css.map

This file was deleted.

Loading

0 comments on commit c9b2f66

Please sign in to comment.