2 ms·
CommonJS worked well enough for lots of things, and it was neat that it was so simple (no new syntax!) But it had limitations, chiefly that imports/exports wer
by brundolf 6y ago
CommonJS worked well enough for lots of things, and it was neat that it was so simple (no new syntax!)
But it had limitations, chiefly that imports/exports were not static. Things got imported at runtime when they got reached, etc. This meant that things like browserify were fudging the semantics in some ways, and it also made it impossible to properly do tree-shaking. The stricter semantics of ES modules are better IMO, despite the pain of transitioning.