Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: warning should not result in non-zero exit code #1872

Merged
merged 5 commits into from Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -102,7 +102,7 @@ You can read more about [Scaffolding](https://webpack.js.org/guides/scaffolding)
| Exit Code | Description |
| --------- | -------------------------------------------------- |
| `0` | Success |
| `1` | Warnings/Errors from webpack |
| `1` | Errors from webpack |
| `2` | Configuration/options problem or an internal error |

## Contributing and Internal Documentation
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-cli/lib/utils/Compiler.js
Expand Up @@ -56,7 +56,7 @@ class Compiler {
logger.error(err.stack || err);
process.exit(1); // eslint-disable-line
}
if (!outputOptions.watch && (stats.hasErrors() || stats.hasWarnings())) {
if (!outputOptions.watch && stats.hasErrors()) {
process.exitCode = 1;
}
if (outputOptions.json === true) {
Expand Down
2 changes: 1 addition & 1 deletion test/loader/warning-test/loader-warning.test.js
Expand Up @@ -8,6 +8,6 @@ describe('loader warning test', () => {

expect(stdout).toContain('[1 warning]');
expect(stdout).toContain('This is a warning');
expect(exitCode).not.toEqual(0);
expect(exitCode).toEqual(0);
});
});
3 changes: 3 additions & 0 deletions test/loader/warning-test/webpack.config.js
Expand Up @@ -27,4 +27,7 @@ module.exports = {
'my-loader': require.resolve('./my-loader'),
},
},
performance: {
hints: 'warning',
},
};