Skip to content

Instantly share code, notes, and snippets.

@shellscape
Created July 9, 2018 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shellscape/71d5adffe79cacb828a831c8322722b9 to your computer and use it in GitHub Desktop.
Save shellscape/71d5adffe79cacb828a831c8322722b9 to your computer and use it in GitHub Desktop.
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