mirror of https://github.com/webpack/webpack.git
17 lines
340 B
JavaScript
17 lines
340 B
JavaScript
|
class ThrowsExceptionInRender {
|
||
|
apply(compiler) {
|
||
|
compiler.hooks.compilation.tap("ThrowsException", compilation => {
|
||
|
compilation.mainTemplate.hooks.requireExtensions.tap(
|
||
|
"ThrowsException",
|
||
|
() => {
|
||
|
throw new Error("Test exception");
|
||
|
}
|
||
|
);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
plugins: [new ThrowsExceptionInRender()]
|
||
|
};
|