bundle-stats 4.0.0-alpha.7 → 4.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,7 +61,6 @@ The CLI is consuming the Webpack stats json. The following [stats options](https
61
61
  {
62
62
  stats: {
63
63
  assets: true,
64
- entrypoints: true,
65
64
  chunks: true,
66
65
  modules: true,
67
66
  builtAt: true,
@@ -74,20 +74,6 @@
74
74
  "size": 48381
75
75
  }
76
76
  ],
77
- "entrypoints": {
78
- "main": {
79
- "assets": [
80
- "vendors.8b6bb4f.css",
81
- "vendors.176a5f6.js",
82
- "vendors.8b6bb4f.css.map",
83
- "vendors.176a5f6.js.map",
84
- "main.e7aed2d.css",
85
- "main.75d52d9.js",
86
- "main.e7aed2d.css.map",
87
- "main.75d52d9.js.map"
88
- ]
89
- }
90
- },
91
77
  "chunks": [
92
78
  {
93
79
  "id": 0,
@@ -105,7 +91,7 @@
105
91
  },
106
92
  {
107
93
  "id": 1,
108
- "entry": false,
94
+ "entry": true,
109
95
  "initial": true,
110
96
  "files": [
111
97
  "vendors.8b6bb4f.css",
@@ -106,20 +106,6 @@
106
106
  "size": 38673
107
107
  }
108
108
  ],
109
- "entrypoints": {
110
- "main": {
111
- "assets": [
112
- "vendors.5024abb.css",
113
- "vendors.278dc2f.js",
114
- "vendors.5024abb.css.map",
115
- "vendors.278dc2f.js.map",
116
- "main.12dd8b1.css",
117
- "main.a0929a4.js",
118
- "main.12dd8b1.css.map",
119
- "main.a0929a4.js.map"
120
- ]
121
- }
122
- },
123
109
  "chunks": [
124
110
  {
125
111
  "id": 0,
@@ -193,7 +179,7 @@
193
179
  },
194
180
  {
195
181
  "id": 5,
196
- "entry": false,
182
+ "entry": true,
197
183
  "initial": true,
198
184
  "files": [
199
185
  "vendors.5024abb.css",
package/bin/index.js CHANGED
@@ -1,92 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const path = require('path');
4
- const yargs = require('yargs');
5
- const updateNotifier = require('update-notifier');
3
+ const { cli } = require('..');
4
+ const packageInfo = require('../package.json');
6
5
 
7
- const pkg = require('../package.json');
8
- const run = require('./run');
9
-
10
- const DEFAULT_OUTPUT_DIR = './dist';
11
-
12
- const notifier = updateNotifier({
13
- pkg,
14
- updateCheckInterval: 1000 * 60 * 60 * 24 * 7,
15
- });
16
-
17
- if (notifier.update) {
18
- notifier.notify();
19
- }
20
-
21
- const { demo } = yargs.parse();
22
-
23
- if (demo) {
24
- run({
25
- html: true,
26
- json: true,
27
- outDir: DEFAULT_OUTPUT_DIR,
28
- artifactFilepaths: [
29
- path.resolve(__dirname, '../__fixtures__/webpack-stats-current.json'),
30
- path.resolve(__dirname, '../__fixtures__/webpack-stats-baseline.json'),
31
- ],
32
- });
33
-
34
- process.exit(0);
35
- }
36
-
37
- const args = yargs
38
- .usage('Usage: $0 OPTIONS [STATS_FILE]...')
39
- .demandCommand(1, 'Webpack stats file path is required.')
40
- .option('out-dir', {
41
- description: 'Output directory',
42
- default: DEFAULT_OUTPUT_DIR,
43
- })
44
-
45
- .option('compare', {
46
- description: 'Use local saved stats for comparison',
47
- boolean: true,
48
- default: true,
49
- })
50
- .option('baseline', {
51
- description: 'Save current stats as baseline',
52
- boolean: true,
53
- default: false,
54
- })
55
-
56
- .option('html', {
57
- description: 'Save HTML report',
58
- boolean: true,
59
- default: true,
60
- })
61
- .option('json', {
62
- description: 'Save JSON data',
63
- boolean: true,
64
- default: false,
65
- })
66
- .option('demo', {
67
- description: 'Generate demo reports',
68
- default: false,
69
- })
70
- .alias('d', 'out-dir')
71
- .alias('h', 'help')
72
- .alias('v', 'version')
73
- .help().argv;
74
-
75
- const {
76
- compare,
77
- baseline,
78
-
79
- html,
80
- json,
81
- outDir,
82
- _: artifactFilepaths,
83
- } = args;
84
-
85
- run({
86
- baseline,
87
- compare,
88
- html,
89
- json,
90
- outDir,
91
- artifactFilepaths,
92
- });
6
+ cli(packageInfo);