Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abort the build for moduleParsed errors
- Loading branch information
1 parent
3faf30c
commit 0ae2877
Showing
5 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
test/function/samples/plugin-error-module-parsed/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
description: 'errors in moduleParsed abort the build', | ||
options: { | ||
plugins: [ | ||
{ | ||
name: 'testPlugin', | ||
moduleParsed() { | ||
throw new Error('broken'); | ||
} | ||
} | ||
] | ||
}, | ||
error: { | ||
code: 'PLUGIN_ERROR', | ||
hook: 'moduleParsed', | ||
message: 'broken', | ||
plugin: 'testPlugin', | ||
watchFiles: [path.join(__dirname, 'main.js')] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
let effect = false; | ||
|
||
var b = { | ||
get a() { | ||
effect = true; | ||
} | ||
}; | ||
|
||
function X() {} | ||
X.prototype = b; | ||
new X().a; | ||
|
||
assert.ok(effect); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters