Just some boilerplate code to get you started with a JavaScript-heavy HTML5 page (e.g. an HTML5 game).
Uses gulp.
git clone --depth=1 --branch=master git://github.com/Thunraz/js-boilerplate.git my-project
cd my-project
rm -rf .git
- Edit
package.json
npm install
npm run dev
There are a few gulp tasks predefined:
clean
compile
Runs the following hidden subtasks:compileMarkup
Transforms your Pug (formerly Jade) file to HTMLcompileScript
Runs rollup on your source code. Entry point is the file src/js/main.jscompileStyle
Concatenates your CSS files (I dropped support for SASS) and minimizes itminifyJS
Minifies your JavaScript codezip
Create a zip archive and prints its file size. Useful for js13kGames.
watch
Starts a local web server that runs on port 8080 (can be overriden using the environment variable GULP_PORT). Rebuilds when files change.