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

Use awesome-typescript-loader instead of ts-loader for typescript plugin #2071

Closed

Conversation

auser
Copy link

@auser auser commented Sep 10, 2017

No description provided.

@gatsbybot
Copy link
Collaborator

gatsbybot commented Sep 10, 2017

Deploy preview ready!

Built with commit d6d0a59

https://deploy-preview-2071--gatsbygram.netlify.com

@jquense
Copy link
Contributor

jquense commented Sep 10, 2017

Hi there, can you talk about what this change is for and what it accomplishes over using the official loader?

@auser
Copy link
Author

auser commented Sep 10, 2017

@jquense Certainly.

The awesome-typescript-loader is much faster than the ts-loader and can be configured with tsconfig.json, whereas the ts-loader isn't.

Specifically, their README does a great job of highlighting the differences.

atl has first-class integration with Babel and enables caching possibilities. This can be useful for those who use Typescript with Babel. When useBabel and useCache flags are enabled, typescript's emit will be transpiled with Babel and cached. So next time if source file (+environment) has the same checksum we can totally skip typescript's and babel's transpiling. This significantly reduces build time in this scenario.

atl is able to fork type-checker and emitter to a separate process, which also speeds-up some development scenarios (e.g. react with react-hot-loader) So your webpack compilation will end earlier and you can explore compiled version in your browser while your files are typechecked.

@KyleAMathews
Copy link
Contributor

One option is to make this a new plugin for awesome-typescript-loader. Pretty cheap to just add new packages.

@KyleAMathews
Copy link
Contributor

@auser want to change the PR to just add a new plugin?

@KyleAMathews
Copy link
Contributor

@auser feel free to resubmit this PR as a new package. Closing for now.

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.

4 participants