-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
prebuild-proposal #7908
Comments
Using tsc for typescript compilation would be great. I can't even use the babel typescript for my project, because due to the (I assume) isolatedModules flag. |
We're currently not planning on adding this type of feature as it increases build complexity, both for the user and Next.js, it also slows down your builds and results in less optimal code delivery. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request?
Conceptually, i want to discuss providing an option to separate the bundle and transpile processes.
this repo and example are just using gulp to demo the process. I'm not advocating using gulp. The main idea is that allowing transpilers to run before bundling:
updated branch : https://github.com/jeremy-coleman/next-tsc-proposal/tree/gulp
tsc incremental watch maintains ~1k ms recompile times on ~100k+ loc projects.
this setup also allows you to hot reload assets outside of the react tree (and therefore maintain hot reloads without using webpack)
Describe the solution you'd like(to discuss)
This just adds an intermediate step to the transpile process, which is neccessary for bulk global transforms such as ts (not file by file like babel). The benefit isnt limited to typescript, it allows for codegen of any kind, such as postcss , shader optimizers, etc. It decouples the transpile and bundle step in a transparent and deterministic step.
Describe alternatives you've considered
every alternative imaginable - this is the best i've found, which is why im sharing it
Additional context
looking for feedback / ideas, how to actually integrate into the next cli should be thought about. Likely using the .next cache as a “staging” area would be a good place to start
this setup actually doesn't require babel at all, so you could theoretically remove it as a dependency from next completely
a finished solution would likely include linting to stdout or an in-browser overlay - trivial to implement, leaving out to focus on structure. Dx would be similar to a gulp watcher
tagging
#7848
The text was updated successfully, but these errors were encountered: