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 recommended caching settings for awesome-typescript-loader #95

Open
flut1 opened this issue Jan 27, 2019 · 6 comments
Open

Use recommended caching settings for awesome-typescript-loader #95

flut1 opened this issue Jan 27, 2019 · 6 comments
Assignees

Comments

@flut1
Copy link
Collaborator

flut1 commented Jan 27, 2019

See: https://github.com/s-panferov/awesome-typescript-loader#performance-issues

These settings should speed up compilation. (we should only enable caching for development)

@flut1 flut1 self-assigned this Jan 27, 2019
@flut1
Copy link
Collaborator Author

flut1 commented Jan 27, 2019

@hjeti I will take care of this if you like. Do you happen to know why we have node_modules in the "include" array of tsconfig.json? This will most likely slow down compilation a lot. These are the only files you would want in that includes array:

  • The entry point. So in our case that would be bootstrap.ts
  • Any files that aren't explicitly referenced in your code, but that still need to be included for typings. For example: a definitions.d.ts file.

While I don't think that it matters much to include our entire src folder (we probably use all these typings anyway), there are potentially a lot of .ts files in node_modules that are irrelevant to our projects.

@ThaNarie
Copy link

I believe WebStorm likes to have the full src/**/*.ts in there to enable project-wide type checking, it doesn't follow imports itself.

@flut1
Copy link
Collaborator Author

flut1 commented Jan 28, 2019

Yeah I think what I said about the entry point might be true for the files array rather than include. Regardless I agree that we should keep "src/**/*.ts". In my experience it's really annoying if Webstorm doesn't pick up your new TS files unless you import them from somewhere.
That does still leave node_modules however, which we should probably remove.

@flut1
Copy link
Collaborator Author

flut1 commented Jan 30, 2019

I ran into the following issue on a different project: s-panferov/awesome-typescript-loader#528

Will need to investigate either adding fork-ts-checker plugin like the comments suggest, or maybe look into using ts-loader instead

@hjeti
Copy link
Owner

hjeti commented Jan 31, 2019

@flut1 I don't remember why I added the node_modules.

If we are going to move away from awesome-typescript-loader maybe we can use the babel typescript preset in combination with the fork-ts-checker-webpack-plugin. I don't know how stable it is but it is used in create-react-app.

@flut1
Copy link
Collaborator Author

flut1 commented Jan 31, 2019

I think I'll have to try both ts-loader, awesome-typescript-loader and babel-typescript in 1 or more projects to see which is fastest. I'll do some benchmarks and will let you know. Additional caching like hard-source-cache-loader seems to make a huge difference in all 3 of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants