"No bundler" replacement of ".ts" to ".js" in html and JavaScript files. #2603
Unanswered
markemerge
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The ECMA teams and the browser vendors have done a great job of defining and implementing a specification for modular JavaScript that we call ES6 modules. According to https://caniuse.com/?search=es6+modules, browser support is at 93%. For me it feels lovely to code to ECMA standards and leave behind the not-so-much-needed-anymore temporary non-standard modular systems that helped get us here.
According to https://caniuse.com/?search=link+preload, the preload browser hint (to counteract the waterfall effect) browser support is at 92%.
With gzip or brotli compression, do we really still need minification, uglification and bundling?
However, browsers do not support strong typing, so I see a great need for TypeScript. I also think tree-shaking is a great idea.
However, I've found it next-to-impossible to use GULP to pipe my ES6 modules and HTML through the TypeScript transpiler and get usable JavaScript on the other side. Am I missing something?
I would love it if anyone could fill me in if there was a good way to process modular TypeScript in JavaScript in such a way that the <script> tags, import statements, etc - are switched from ".ts" to ".js".
Secondly I would love to know if anyone has found a way to perform "treeshaking" with TypeScript and ES6 modules.
Thoughts appreciated.
Beta Was this translation helpful? Give feedback.
All reactions