DEV - versions of JS files written to a JS file to be included by loa… (PR #10649)

This is a different(/simpler?) approach that attempts to solve the issue that https://github.com/discourse/discourse/pull/10575 was trying to address.

GitHub

This looks great, I like that the rake task writes to a JS file directly instead of injecting it via Rails.

In the js world we use kebab-case (dasherize) for module names.

This looks very nice! I like it a lot. My feedback is all minor.

      if (typeof version !== "undefined") {

This is preferred due to the unusual case that undefined can be overwritten :crazy_face:

These two tests have async but are synchronous. Should be dropped.