forked from janl/mustache.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put mustache.version into place by build step
Historically we haven't had a build step that did any transformations on the .js source code, except for one ad-hoc search-n-replace trick; putting the current version number into the source code, into the `mustache.version` field. Now that we've got a proper build step in place with rollup.js, which transforms the `.mjs` source into `.js | .min.js` versions, we might as well improve how the version number gets into `mustache.version` field. These changes uses rollup-plugin-json plugin to make that happen, allowing us to `import` our `package.json` to extract what's inside its `version` field. The end result is rollup.js inlining that version value into the built UMD version found in `mustache.js`. Therefore we don't need the old ad-hoc search-n-replace trick that we've had in a pre-commit hook for quite some time now.
- Loading branch information
Showing
6 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import json from "rollup-plugin-json"; | ||
|
||
export default { | ||
input: "mustache.mjs", | ||
output: { | ||
file: "mustache.js", | ||
format: "umd", | ||
name: "Mustache", | ||
banner: "// This file has been generated from mustache.mjs" | ||
}, | ||
plugins: [json()] | ||
}; |