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

Compiler option to combine and downgrade external modules with outFile #17537

Closed
govis opened this issue Jul 31, 2017 · 4 comments
Closed

Compiler option to combine and downgrade external modules with outFile #17537

govis opened this issue Jul 31, 2017 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@govis
Copy link

govis commented Jul 31, 2017

As per compiler message: Only 'amd' and 'system' modules are supported alongside --outFile. It appears that it also accepts "module": "none", with no module contents being compiled into the output file.

I was wondering if we could have have this (or other option) still compile the contents but leave the module semantics out instead?

Given that in a combined .js file modules lose their benefit, would it not make sense to replace resulting System.register(system) define(amd) with plain IIFEs in this case?

@RyanCavanaugh
Copy link
Member

Duplicate of #4434 ?

@RyanCavanaugh RyanCavanaugh marked this as a duplicate of #4434 Jul 31, 2017
@govis
Copy link
Author

govis commented Aug 1, 2017

It looks like #4434 is way too broad and suggests preserving ES6 module semantics - why preserve modules in a combined .js file?

#7671 is closer to what I was thinking - convert modules to simple IIFEs while concatenating. Something similar to rollup's --format iife while leveraging tsc options for choosing which files to include and exclude.

A use case would be generating down-level .js file from module-based sources for <script nomodule> tag to fallback when (ES6) modules are not supported by the browser. Kind of opposite from what #4434 is trying to achieve when it comes to module semantics. Thanks.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 23, 2017

It looks like #4434 is way too broad and suggests preserving ES6 module semantics - why preserve modules in a combined .js file?

cause this is what users expect from a compiler, to have consistent semantics :)

#7671 is closer to what I was thinking - convert modules to simple IIFEs while concatenating. Something similar to rollup's --format iife while leveraging tsc options for choosing which files to include and exclude.

ES6 is the standard of the web, it has a well defined concept of modules, and we believe this is where most future investments would be. we are not planning on adding a new module format.

We believe this is job better left to other tools like rollup, systemjs, webpack.. etc..

@mhegazy mhegazy added the Duplicate An existing issue was already created label Aug 23, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Sep 6, 2017

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@mhegazy mhegazy closed this as completed Sep 6, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants