Sitelet https://github.com/sorrycc/roadhog/commit/f49475fa80ae249284e29af8de9ab20c8196f76c
Skip to content

Commit f49475f

Browse files
committed
feat: bigbrother dev
1 parent db649f6 commit f49475f

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

‎src/dev.js‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { resolve } from 'path';
1+
import { resolve, join } from 'path';
22
import dev from 'af-webpack/dev';
33
import chalk from 'chalk';
4+
import BuildStatistics from 'build-statistics-webpack-plugin';
5+
import BigBrother from 'bigbrother-webpack-plugin';
46
import getConfig, {
57
watchConfigs,
68
unwatchConfigs,
@@ -54,6 +56,25 @@ export default function runDev(opts = {}) {
5456
entry,
5557
});
5658

59+
const stagesPath = join(
60+
__dirname,
61+
'../.run/build-statistics/compilation.json',
62+
);
63+
const roadhogPkg = require(join(__dirname, '../package.json'));
64+
webpackConfig.plugins.push(
65+
new BuildStatistics({
66+
path: stagesPath,
67+
}),
68+
new BigBrother({
69+
cwd,
70+
tool: {
71+
name: 'roadhog',
72+
version: roadhogPkg.version,
73+
stagesPath,
74+
},
75+
}),
76+
);
77+
5778
dev({
5879
webpackConfig,
5980
proxy: config.proxy || {},

0 commit comments

Comments
 (0)