-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.js
More file actions
24 lines (22 loc) · 896 Bytes
/
Copy pathdebug.js
File metadata and controls
24 lines (22 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const webpack = require('./webpack-simple');
const config = require('./webpack.config');
const fs = require('fs');
const compiler = webpack(config);
// 4.执行对象的 run 方法开始执行编译
compiler.run((err, stats) => {
console.log('====================================');
console.log(stats.toJson({
modules:true,//每个文件都是一个模块
chunks:true,//打印所有的代码块,模块的集合会成一个代码块
assets:true//输出的文件列表
}));
console.log('====================================');
let statsString = JSON.stringify(
stats.toJson({
modules:true,//每个文件都是一个模块
chunks:true,//打印所有的代码块,模块的集合会成一个代码块
assets:true//输出的文件列表
})
);
fs.writeFileSync('./myStats.json',statsString);
});