File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 3
3
Website gzip compression makes it possible to reduce the file size of a file
4
4
to roughly 30% of its original size before the files are sent to the browser.
5
5
6
+ It is enabled by default.
7
+
8
+ ## ` --compress `
9
+
6
10
To run this example, run this command in your console or terminal:
7
11
8
12
``` console
9
13
npm run webpack-dev-server -- --open --compress
10
14
```
11
15
12
- ## What should happen
16
+ ### What should happen
13
17
14
18
1 . The script should open ` http://localhost:8080/ ` .
15
19
2 . Files being sent to the browser from the ` webpack ` bundle should be gzipped.
16
20
3 . Open the console in your browser's devtools and select the _ Network_ tab.
17
21
4 . Find ` bundle.js ` . The response headers should contain ` Content-Encoding: gzip ` .
18
22
23
+ ## ` --no-compress `
24
+
25
+ To run this example, run this command in your console or terminal:
26
+
27
+ ``` console
28
+ npm run webpack-dev-server -- --open --no-compress
29
+ ```
30
+
31
+ ### What should happen
32
+
33
+ 1 . The script should open ` http://localhost:8080/ ` .
34
+ 2 . Files being sent to the browser from the ` webpack ` bundle should be gzipped.
35
+ 3 . Open the console in your browser's devtools and select the _ Network_ tab.
36
+ 4 . Find ` bundle.js ` . The response headers should not contain ` Content-Encoding: gzip ` .
37
+
19
38
## Notes
20
39
21
40
Some browsers, such as Chrome, won't show the ` Content-Encoding: gzip ` within
You can’t perform that action at this time.
0 commit comments