Skip to content

Commit

Permalink
Introduce build step to generate .js | .min.js from .mjs
Browse files Browse the repository at this point in the history
By making the main source code an ES module placed in `mustache.mjs`,
what used to be in `mustache.js` is now built based off of the ES module
source inside `mustache.mjs`.

This is done primarily to avoid breaking existing projects already using
mustache.js, by keeping the UMD-version in `mustache.js` part of the git
repository in addition to the minified version in `mustache.min.js`.

After experiment with several compilers;

- Babel
- TypeScript
- Rollup

and examining their build output, [Rollup](https://rollupjs.org/) was chosen
because of the UMD output it creates which closely resembles what we've
historically had in the previous `mustache.js` source code.

The contents of `.js | .min.js` files has been generated by running
the following npm script:

```
$ npm run build
```
  • Loading branch information
phillipj committed Oct 7, 2019
1 parent 9e7aa9c commit 8b31b93
Show file tree
Hide file tree
Showing 4 changed files with 757 additions and 31 deletions.
Loading

0 comments on commit 8b31b93

Please # to comment.