|
@jankrems | |||||
|
All differences between JavaScript modules, classic scripts, and CommonJS. gist.github.com/jkrems/b14894e…
For the next time somebody asks me "why have different file extensions?".
|
||||||
|
||||||
|
Mathias Bynens
@mathias
|
28. pro |
|
Nit: JavaScript’s HTML comments syntax creates single-line comments, not block comments. (You might be thinking of HTML comments in HTML.)
|
||
|
|
||
|
Jan @ Home
@jankrems
|
29. pro |
|
That’s what I get for not just saying “comments”. Never realized, thanks!
|
||
|
|
||
|
Matteo Collina
@matteocollina
|
30. pro |
|
I think it's important to mention that commonjs predates modules and all things webpack/babel/rollup/* are based on commonjs as it is the majority of npm.
|
||
|
|
||
|
Jan @ Home
@jankrems
|
30. pro |
|
Good point! The order is a bit arbitrary right now. I was tempted to also throw in history stuff, including UMD/AMD/etc but it ended up more verbose than useful. :(
|
||
|
|
||