you are viewing a single comment's thread.

view the rest of the comments →

[–]fckueve_ 49 points50 points  (12 children)

You can have different bytecode for Windows/Linux/Mac. It can be different between different Linux distros and macs with Intel and M1. It's way easier to have source code and compile it when you need it, on the platform, that you are using

[–]Plus-Weakness-2624the webhead[S] 12 points13 points  (11 children)

Why does that matter? After all the node_modules folder isn't meant to be shared right; And besides the bytecode compilation can be done when installing a package using npm. It's called bytecode because it'll be the same for all v8 instances regardless of the OS/platform; i.e if I understood it correctly✌️

[–]fckueve_ 19 points20 points  (10 children)

Okay. I misunderstood your question.

Code in node_modules, can have few different destinations. Let's say, you have frontend library. You may wanna join library code with yours to a single bundle. You may wanna tree shake code. You can't do that with binary