Skip to content

Commit

Permalink
👟 add Makefile tasks: bundle, uglify, hint & dist
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Apr 2, 2019
1 parent 9479789 commit c78319e
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
bower_components/
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
bundle:
cat js/boilerplate.js js/canvas-renderer.js js/svg-renderer.js js/vector.js \
js/anchor.js js/path-command.js js/shape.js js/group.js js/rect.js \
js/rounded-rect.js js/ellipse.js js/polygon.js js/hemisphere.js \
js/cylinder.js js/cone.js js/box.js > dist/zdog.dist.js

uglify:
npx uglifyjs dist/zdog.dist.js -o dist/zdog.dist.min.js --mangle --comments /^!/

hint:
npx jshint js/*.js

dist: hint bundle uglify
2 changes: 1 addition & 1 deletion js/svg-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
( function( root, factory ) {
// module definition
if ( typeof module == 'object' && module.exports ) {
/* globals define */ // CommonJS
/* globals module */ // CommonJS
module.exports = factory();
} else {
// browser global
Expand Down
275 changes: 275 additions & 0 deletions package-lock.json

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

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"version": "0.1.0",
"description": "Round, flat, designer-friendly pseudo-3D engine",
"main": "js/index.js",
"dependencies": {},
"devDependencies": {
"jshint": "^2.10.2",
"uglify-js": "^3.5.3"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down

0 comments on commit c78319e

Please sign in to comment.