-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Commonjs and Webpack #19
Comments
@regevaz well in c# you implicitly get references to all of the stuff in the same namespace. That's not the case with TypeScript and Webpack. Since as soon as you do not explicitly reference (using the import statement) to the ts-files you require, Webpack will not include it in the bundle and the reference will be missing. |
thanks for the reply. |
Well I think we need to define some kind of mapping from c# assemblies and namespaces towards TypeScript's module system. Somehow I would like to build modules that consist out of multiple TypeScript files and then reference such a module with only one import directive. Maybe it's already possible if I would know how? |
Exactly! well, AFAIK, we should wait until Typescript will be more matured :) |
Do you think it is preferable to switch over to Commonjs module code generation in combination with Webpack?
The main benefit I see is that dependencies are tracked through explicit imports within the .ts-files instead of having to wire them up manually in index.html or the tsconfig-files section to maintain execution order. Additionally, Webpack reduces configuration complexity compared to the chaining of several gulp tasks and its system also incorporates the bundling of styles and vendor assets through explicit referencing from within .ts-files.
A major downside I feel is that in the Commonjs pattern you will need to add explicit references in every .ts-file you produce.
The text was updated successfully, but these errors were encountered: