Re:Ncc: Node.js Compiler Collection
by SOLAR_FIELDS on Monday November 26, 2018 @04:27PM
(#18536943)
I thought the same when I read the article. It sounds like it’s just a wrapper around webpack. Why wouldn’t I just use webpack aside from this tool being marginally faster? Is there something I’m missing here? Couldn’t we just take their improvements and implement them in webpack?
The goal is to provide the experience that many other languages have, where you don’t configure anything. You just run “$tool build”
Re:Ncc: Node.js Compiler Collection
by idle_zealot on Monday November 26, 2018 @06:16PM
(#18537733)
Generally $tool has a config file in the root of the project or similar. Webpack and other js compilers/bundlers are the same.
Webpack works with no configuration as of version 4.
The goal is precisely to not just bundle, but incorporate important optimizations like the V8 Compile Cache (https://github.com/zeit/ncc/issues/51), which is what inspired the project and name to begin with.
Seems like it'd be better as a webpack plugin. It's still not a compiler, by the way, nor a compiler collection, even with this feature included.
It is a compiler. Literally
It seems to me that the compiler here is V8.
One of these things is not like the other.
It’s definitely possible to extract some internals as plugins, but not all currently.
It would make more sense as a collection of plugins, and perhaps exposed as a preset.
But the intent is to precisely remove the extra setup, when all you need to do is publish your Node.js codebase as a single file.
Re:Ncc: Node.js Compiler Collection
by iforgotpassword on Monday November 26, 2018 @04:46PM
(#18537098)
cat **.js > myprog.js
As far as I can tell this seems to be approximately 2,000 lines of JavaScript (half of which is tests) that wires together existing tools in an rather un-novel way. Or, in other words: an ad for "zeit".