Skip to content

Commit

Permalink
Build script and instructions (#270)
Browse files Browse the repository at this point in the history
Build script and instructions + minor cleanups
  • Loading branch information
kplindegaard authored Feb 17, 2024
1 parent 860e47d commit 720fb9c
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 4 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,16 @@ gauge.js can be wrapped to a number of frameworks. Here are some examples:

* **Vue**
* [vgauge](https://github.com/amroessam/vgauge)
* **React**
* [react-gaugejs](https://github.com/keanemind/react-gaugejs)

## Build instructions

Build is a two-step process. First, the CoffeeScript source `gauge.coffee` is converted to `gauge.js`. Next, [terser](https://www.npmjs.com/package/terser) produces the minified distribution file `gauge.min.js`.

```bash
# Install development dependencies
npm install
# Run the build
npm run build
```
2 changes: 1 addition & 1 deletion dist/gauge.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions dist/gauge.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gauge.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h2>Features</h2>
<li>No dependencies (jQuery is <a href="#jquery">supported</a>, but not required)</li>
<li>Highly configurable</li>
<li>Resolution independent</li>
<li>Animated guage value changes (!)</li>
<li>Animated gauge value changes (!)</li>
<li>Works in all major browsers</li>
<li>MIT License</li>
</ul>
Expand Down
252 changes: 252 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@
"url": "[email protected]:bernii/gauge.js.git"
},
"author": "bernii",
"license": "MIT"
"license": "MIT",
"devDependencies": {
"coffeescript": "^1.12.7",
"terser": "^5.27.1"
},
"scripts": {
"build:coffee": "coffee -c -m -o ./dist/ ./dist",
"minify": "terser ./dist/gauge.js -m -o ./dist/gauge.min.js -c",
"build": "npm run build:coffee && npm run minify"
}
}

0 comments on commit 720fb9c

Please sign in to comment.