-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
I sugguest outFiles, who can act M: N merge #13115
Comments
Nice write-up and we would probably use this internally if it existed. But we're generally pushing people toward using modules and external bundlers to produce output files and hope that |
Thanks for responding. I'm developing some web applications that cannot avoid using many importScripts
(
"tstl.js",
"samchon.js",
"statistics.js",
"geometry.js"
); In the web development and using |
I like the proposal as well. My biggest issue is "Debugging" as the Visual Studio debugger does only allow me to debug the files in one (VS) project. I therefore have to make a decision to have all my TS files compiled into separate JS files or combine them ALL into one JS File. I cannot create layers of multiple TS files compiling into multiple (but fewer) JS files. The proposal on here would allow me to create layers like "Core.JS", "Communication.JS", "UX.JS" (outfiles) and each of them having multiple TS files. I can then debug my project easy in VS. Right now I have a primary TS project with all my "Stack" TS files compiling into one JS file and a second project with my higher level "stack API consuming" TS files. The Index.html loads both resulting JS files but I can only debug either the stack or the consumer - not both (across the two projects). The multiple outfiles solution would help me with this layered structure (without using any other tools that merge files and make debugging impossible). |
Ordinary "outFile" is
M: 1 Merging
When we write lots of codes that are difficult write in few
TS
files, however the codes should be merged into a singleJS
file, then we can take one of them:Use module system like CommonJS or RequireJSoutFile
The
outFile
parameter intsconfig.json
letsTSC
to merge multiplets
files into a singlejs
file.M: N Merging?
The
outFile
merges into only a single JS file. If someone wants to merge multiple TS files into multipleJS
files (less fewer), then how should do? Using module system is a standard solution now, But I think the outFiles can be an alternative solution.Use module system like CommonJS or RequireJSSpecification
Example
Using module system is possible
Not like outFile, I wish to using module system is possible in the outFile.
Arrange JS files to be generated and specify TS files to be merged
To act M: N merging, declare an object named outFiles and arranges JS files to be generated and TS files to be merged. Path of JS files are
key_type
and Array of TS files arevalue_type
.Specifying Directories
Not only specifying TS files, but also specifying a directory would be better. When a directory is referenced in the Array, then all the TS files in the directory will be merged into the target JS file.
Conditional Specification
I think not only using the exact, pull path of TS files, but also using the conditional specification would be better.
Comparing with Module System
Convenient Modularization
M: N merging, it is also possible through the module system. However, the outFiles can be more convenient in some cases.
API Documentation
To generate clean and neat API documents (unless writes API documents by hand manually), smaller number of modules are much favorable.
If not using the Module System
Developing web application without module system, but including JS files directly, it's not normal case in nowadays. However, it's not extinct yet.
For the minorities, not only providing outFile method, but also providing the outFiles method will be much helpful.
The text was updated successfully, but these errors were encountered: