-
Notifications
You must be signed in to change notification settings - Fork 492
different tsconfig compiler options when building the production bundle. #218
Comments
Did you ever find the answer to this? |
In particular, as much as I love the option |
It doesn't look like it's possible to change which tsconfig file is used without ejecting, so I guess you'd have to eject in order to set a different compiler target for production. @StanleyGoldman I found that option really distracting while developing as well. My solution was to disable the But I only wanted to disable it during development, not production. So I followed the recommendation in #238 and set
(cross-env is just a way of setting an environment variable that works on Linux/Mac/Windows...if you don't care about Windows then you could just do As explained in #238, this approach also requires adding That's all you need for a basic setup. But I also wanted a precommit hook so that it wasn't possible to commit changes that hadn't passed tslint. This took a little more work...first I created a separate tslint config file called
Then I used lint-staged so that the precommit hook would only run tslint on files that have been staged in git. The lint-staged config should include:
Now, assuming you have husky or similar set up to actually run the precommit hook, you should get an error when trying to commit any files with unused variables, but during development unused variables will only trigger a warning. Any files not staged to git will be ignored (even if they have linting errors). |
@mbrowne those are good solutions! 👌 |
Hey, I think this will be fixed in #299 - can you confirm and close. Thanks! |
Hey there, thanks for this awesome module.
Quick question, is it possible to specify additional/different tsconfig compiler options when building the production bundle. I would like to set the target to
es2017
in dev for example, andes5
in production.The text was updated successfully, but these errors were encountered: