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

Feature/108 exit code #143

Closed
wants to merge 2 commits into from
Closed

Conversation

EvAlex
Copy link

@EvAlex EvAlex commented Jan 21, 2016

This provides a workaround for #108. The issue is very simple to reproduce:

  1. Add some mess to TypeScript code to get compilation error(s).
  2. Run webpack with ts-loader
  3. Check exit code. It is 0.

That's a major problem, because build server executing such build will report success when there are errors in TypeScript code.

Workaround is simple and consists of 2 steps:

  1. Add plugin that executes on done and exits process with non-zero exit code if error(s) present
  2. Add logging to ts-loader in order to provide detailed info on compilation error(s)

The solution works fine on my project.

@jbrantly
Copy link
Member

Thank you for taking the time to put together code and submit a PR. However, I'm not sure I want to go down this path quite yet. I still believe the right way to do this is to use noEmitOnError (broken right now) and --bail. It's possible that --bail might not work how it's supposed to (I have some vague recollection of reading about that in a webpack issue) but even if it doesn't I would rather add a new ts-loader config option than document a way to handle process.exit through a plugin.

I'm going to hold off on merging this until I've explored the other approach.

@jbrantly
Copy link
Member

Closing in favor of #172

@jbrantly jbrantly closed this Apr 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants