|
|
|
|
|
by bengillies
4916 days ago
|
|
If you're using a library that stitches together multiple JavaScript files - all of which work when included via separate script tags - and the resultant file doesn't work (due to the issue mentioned in TFA at least), then that's a bug in the library that stitches multiple JavaScript files together, and should be fixed there. Adding a semicolon to the start of your IIFE doesn't really hurt, but it's a workaround more than a solution. |
|
These are conventions, not because you have to, but because you avoid other issues further down. You COULD simply write all your scripts inline.. and if you are judicious it is probably a bit better performing. That doesn't mean you want to... JavaScript in practice is much more about convention to prevent/limit obstacles than a "one right way" philosophy.
Hell, look at CommonJS vs AMD and the various solutions there alone... not even including all the one-off processes that have been used over the years.