The project structure will be similar to the previous projects. In lib
, we will place our sources. We separate the files for the framework and the game in lib/framework
and lib/game
. In lib/tsconfig.json
, we configure TypeScript:
{ "compilerOptions": { "target": "es5", "module": "commonjs", "strictNullChecks": true } }
In the root directory, we set up gulp in gulpfile.js
:
var gulp = require("gulp"); var ts = require("gulp-typescript"); var small = require("small").gulp; var tsProject = ts.createProject("lib/tsconfig.json"); gulp.task("compile", function() { return gulp.src("lib/**/*.ts") .pipe(ts(tsProject)) .pipe(small("game/index.js", { outputFileName: { standalone: "scripts.js" }})) .pipe(gulp.dest("static/scripts/")); }); gulp.task("default", ["compile"]);
We can install our dependencies with NPM.
npm init -y...