Skip to content

Commit

Permalink
build system implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
agar3s committed Aug 17, 2018
1 parent d3cb2f2 commit 1b3599c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ typings/
# skip dist files
dist
package-lock.json
target/build.js
target*
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"description": "my entry for the #js13k 2018",
"main": "index.js",
"scripts": {
"concat": "./scripts/concat.sh > target/build.js",
"concat": "./scripts/concat.sh > dist/build.js",
"clean": "rm target.zip; rm -rf dist/; rm -rf target/; mkdir -p dist target",
"minify": "npx google-closure-compiler --compilation_level=ADVANCED_OPTIMIZATIONS --js=dist/build.js --js_output_file=dist/build.min.js",
"gen": "cp src/index.html target/index.html && cp dist/build.min.js target/b.js",
"zip": "cd target; zip -r ../target.zip .; cd ..; wc -c target.zip",
"build": "export NODE_ENV=production; npm run clean && npm run concat && npm run minify && npm run gen && npm run zip",
"watch": "nodemon -e js,sh --watch src --watch scripts --exec npm run concat",
"liveserver": "mkdir -p target; cd target; live-server --no-browser",
"start": "npm run watch & npm run liveserver"
Expand All @@ -25,5 +30,8 @@
"devDependencies": {
"live-server": "^1.2.0",
"nodemon": "^1.18.3"
},
"dependencies": {
"google-closure-compiler": "^20180805.0.0"
}
}
35 changes: 1 addition & 34 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
<head>
<title>JS13K 2018 @agar3s</title>
<style>
body{
background:#333;
margin:0;
padding:0;
}
canvas{
}
#c{
background: #fff;
}
#f{
font-family:monospace;
position:absolute;
bottom:10px;
left:10px;
font-size:21px;
color:#993;
text-decoration:none;
}
#f:hover{
color:#9aa;
}
</style>
</head>
<body allowfullscreen>
<div id="d">
<canvas id="c" width="320" height="240"></canvas>
</div>
<a href='#' id='f' title='fullscreen'>FullScreen</a>
<script src="../dist/build.js"></script>
</body>
<head><title>JS13K 2018 @agar3s</title><style>body{background:#333;margin:0;padding:0;}#c{background: #fff;}#f{font-family:monospace;position:absolute;bottom:10px;left:10px;font-size:21px;color:#993;text-decoration:none;}#f:hover{color:#9aa;}</style></head><body allowfullscreen><div id="d"><canvas id="c" width="320" height="240"></canvas></div><a href='#' id='f' title='fullscreen'>FullScreen</a><script src="b.js"></script></body>
2 changes: 1 addition & 1 deletion src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ function Sprite() {
}
}

var player = new Sprite();
var player = Sprite();

0 comments on commit 1b3599c

Please sign in to comment.