You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot use certain npm modules because they only support cjs, which I would be easily able to use with webpack. Even for modules made for web the process is still painful -- having to add the module to externals, copying the bundle, and manually modifiying the HTML to use it / or a cdn.
The text was updated successfully, but these errors were encountered:
If your npm module is written in a way that is compatible with Closure Compiler, then the answer is it could be. I haven't had much exprience on it yet, but there is --process_common_js_modules flag that is used by closure compiler webpack plugin to transform commonjs modules to a form that closure can understand, so we may utilize it.
If not - I don't see any overlap of it with the scope of tscc. You can still use browserify or webpack to first transform commonjs modules into a web-compatible format and then append to html as a script tag.
Just speculating, maybe part of the functionality of TSCC can be built as a plugin to webpack and it will resolve your use case. Among sources provided to rollup or webpack, it may be possible to compile things specified in the spec file with tsickle + closure compiler, and somehow wire it up with the rest of them. I'd welcome If someone has more idea on implementing this.
foobardevpro
changed the title
Will commonjs modules ever be supported without resorting to externals compiler option?
Will npm modules ever be supported without resorting to externals compiler option?
Oct 4, 2019
I cannot use certain npm modules because they only support cjs, which I would be easily able to use with webpack. Even for modules made for web the process is still painful -- having to add the module to externals, copying the bundle, and manually modifiying the HTML to use it / or a cdn.
The text was updated successfully, but these errors were encountered: