Skip to content

Commit d380151

Browse files
author
yangfan19
committed
20-配置eslint
1 parent cee965e commit d380151

File tree

12 files changed

+1342
-131
lines changed

12 files changed

+1342
-131
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ webpack-cli: "^3.3.2"
3232
- [`webpack-17`](./webpack-17/README.md) — 使用 source map
3333
- [`webpack-18`](./webpack-18/README.md) — 提取页面的公共资源
3434
- [`webpack-19`](./webpack-19/README.md) — 代码分割-动态 import
35+
- [`webpack-20`](./webpack-20/README.md) — 配置 eslint

webpack-19/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,3 @@ npm run build
3030

3131
- 抽离想用的代码到一个共享快
3232
- 脚本懒加载、使得初始下载的代码更小
33-
34-
### 相关资源
35-
36-
<!-- [Tree Shaking](https://webpack.docschina.org/guides/tree-shaking/) <br /> -->

webpack-20/README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# webpack-19
1+
# webpack-20
22

3-
## 代码分割
3+
## 配置 eslint
44

5-
对于大的 web 应用来讲,将所有的代码放在一个文件中显然是不够有效的,特别是当你的代码块是在某些特殊的时候才能被用到,webpack 有有个功能就是讲你的代码库分割成 chunks,当代码运行的时候才进行加载。
5+
推荐使用 github 上的一些开源好的规则仓库,比如:[standard](https://github.com/standard/standard)
66

77
<br />
88

@@ -11,26 +11,21 @@
1111
/src/search/index.js
1212

1313
```shell
14-
npm i @babel/plugin-syntax-dynamic-import -save-dev
14+
npm install standard --save-dev
1515

16-
npm run build
1716
```
1817

1918
<br />
2019

21-
.babelrc
20+
package.json
2221

2322
```shell
24-
"plugins":["@babel/plugin-syntax-dynamic-import"]
23+
"scripts": {
24+
...
25+
"eslint": "standard && node src/*/*.js",
26+
"flx": "standard --fix",
27+
},
28+
2529
```
2630

2731
<br />
28-
29-
## 场景
30-
31-
- 抽离想用的代码到一个共享快
32-
- 脚本懒加载、使得初始下载的代码更小
33-
34-
### 相关资源
35-
36-
<!-- [Tree Shaking](https://webpack.docschina.org/guides/tree-shaking/) <br /> -->

0 commit comments

Comments
 (0)