Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forward bundle through watch error events (#3909)
- Loading branch information
1 parent
add322c
commit 850d30a
Showing
7 changed files
with
68 additions
and
33 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
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
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,19 @@ | ||
const { assertIncludes } = require('../../../../utils.js'); | ||
|
||
module.exports = { | ||
description: 'closes the bundle on generate errors', | ||
command: 'rollup -cw', | ||
abortOnStderr(data) { | ||
if (data.includes('Bundle closed')) { | ||
return true; | ||
} | ||
}, | ||
stderr(stderr) { | ||
assertIncludes( | ||
stderr, | ||
'[!] Error: You must specify "output.file" or "output.dir" for the build.' | ||
); | ||
assertIncludes(stderr, 'Bundle closed'); | ||
return false; | ||
} | ||
}; |
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 @@ | ||
export default 42; |
14 changes: 14 additions & 0 deletions
14
test/cli/samples/watch/close-on-generate-error/rollup.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,14 @@ | ||
export default { | ||
input: 'main.js', | ||
plugins: [ | ||
{ | ||
name: 'faulty-close', | ||
closeBundle() { | ||
console.error('Bundle closed') | ||
} | ||
} | ||
], | ||
output: { | ||
format: "es" | ||
} | ||
}; |