Gulp-based workflow for JS13KGames projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dependabot[bot] f98b4a2b9a Bump mixin-deep from 1.3.1 to 1.3.2 5 months ago
dist Initial commit 1 year ago
src Add image optimization to gulp workflow 1 year ago
.eslintrc.yml Initial commit 1 year ago
.gitignore Remove zip folder from VCS 1 year ago
.stylelintrc Fix and modify gulp workflow 1 year ago
gulpfile.js Fix `dist` cleaning 1 year ago
package-lock.json Bump mixin-deep from 1.3.1 to 1.3.2 5 months ago
package.json Switch to terser for JS minification 1 year ago
readme.md Switch to terser for JS minification 1 year ago

readme.md

JS13kGames Boilerplate

Boilerplate for JS13kGames projects. Fork of js13k-starter.

This is what works for me; it might work for you, but it might not. Feel free to modify this to fit your needs.

Features

Installation

git clone https://github.com/shreyasminocha/js13k-boilerplate

mv js13k-boilerplate [NAME OF YOUR GAME]
cd [NAME OF YOUR GAME]

rm -rf .git
npm install # install devDependencies

rm readme.md
$EDITOR package.json # change package details

Usage

  • gulp build / npm run build
    • Concatenate CSS files (src/css/*.css)
    • Concatenate JS files (src/js/*.js)
    • Minify HTML, CSS and JS to dist/index.html, dist/style.min.css and dist/script.min.js respectively
    • Correct links to CSS and JS files in dist/index.html
    • Optimize images in src/images using gifsicle, jpegtran, optipng, svgo and place them in dist/images.
    • Compress dist to zip/game.zip
    • Warn if zip/game.zip is larger than 13kb
  • gulp test / npm test
    • Lint HTML, CSS, JS and fail on error.
  • gulp
    • Run gulp build
    • Watch src for changes and build on change.

Server

I prefer to run the game using hotel. I’ve set hotel to run the game from dist using http-server.

cd dist
hotel add --name "game" 'http-server -p "$PORT" -c-1'

Since I’ve set up .localhost domains for hotel apps, I would be able to access the game at game.localhost.

You might prefer running a server through gulp. Feel free to modify gulpfile.js in your clone to fit your needs.

License

Licensed under the MIT License.