Skip to content

Commit 3d965a9

Browse files
committed
small updates
1 parent 1d7df88 commit 3d965a9

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

  • version 4/03 environments/07 Webpack Monitor

version 4/03 environments/07 Webpack Monitor/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 07 Webpack Monitor
22

3-
In this demo we are going to install and configure the "Webpack Monitor" plugin which captures relevant statistics on our builds and provide an interactive analysis tool of bundle composition.
3+
In this demo we are going to install and configure the [Webpack Monitor](http://webpackmonitor.com/) plugin which captures relevant statistics on our builds and provide an interactive analysis tool of bundle composition.
44

55
We will start from sample _03 Environments/06 Bundle Analyzer_
66

@@ -32,21 +32,33 @@ npm install webpack-monitor --save-dev
3232

3333
- Add the plugin to our _dev.webpack.config.js_:
3434

35+
1.- Create the following variable:
3536

37+
_./dev.webpack.config.js_
38+
39+
```diff
40+
const merge = require('webpack-merge');
41+
const base = require('./base.webpack.config.js');
42+
const Dotenv = require('dotenv-webpack');
43+
+ const WebpackMonitor = require('webpack-monitor');
3644
```
37-
1.- Create the following variable:
3845

39-
const WebpackMonitor = require('webpack-monitor');
40-
4146
2.- Add the following entry into the plugins array:
4247

43-
new WebpackMonitor({
44-
capture: true, // -> default 'true'
45-
target: '../monitor/myStatsStore.json', // default -> '../monitor/stats.json'
46-
launch: true, // -> default 'false'
47-
port: 3030, // default -> 8081
48-
})
49-
48+
_./dev.webpack.config.js_
49+
50+
```diff
51+
plugins: [
52+
new Dotenv({
53+
path: './dev.env',
54+
}),
55+
+ new WebpackMonitor({
56+
+ capture: true, // -> default 'true'
57+
+ target: '../monitor/myStatsStore.json', // default -> '../monitor/stats.json'
58+
+ launch: true, // -> default 'false'
59+
+ port: 3030, // default -> 8081
60+
+ }),
61+
],
5062
```
5163

5264
- Parameters explanation:
@@ -63,6 +75,6 @@ new WebpackMonitor({
6375
```
6476

6577
- Now we can see our Webpack Monitor plugin working! Simply execute the command `npm run build:dev`
66-
Depending on your machine, it could takes a while for the plugin to show up on your browser. Be patient!
78+
Depending on your machine, it could takes a while for the plugin to show up on your browser. Be patient!
6779

6880
![Snapshot Webpack Monitor](./readme-resources/webpack_monitor.png)

0 commit comments

Comments
 (0)