Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove a Compiler instance from a Webpack instance
const webpack = require('webpack');
const config = require('../fixtures/multi/webpack.config.js');
delete config.serve;
const compiler = webpack(config);
compiler.compilers = [
compiler.compilers.find((comp) => comp.name === 'server'),
];
compiler.hooks.done.tap('test', (stats) => {
stats.stats = stats.stats.filter((stat) => !!stat);
});
compiler.hooks.done.tap('test', (stats) => {
console.log(stats);
});
// console.log(found);
compiler.run((err, stats) => {
// console.log(err);
// console.log(`tostring${stats.toString()}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment