-
Notifications
You must be signed in to change notification settings - Fork 5
Build Process
IDEs will use the top level tsconfig file, which will not produce runnable code, and must only be used for errors highlighting in the editor and such.
The runnable code is produced by the Grunt build, which must be launched before testing and use more advanced tsconfig files. The Grunt build is configured so that TypeScript files are compiled as:
- Many minified scripts for client-side code (/client/dist/*.js)
- Many ES6 modules for server-side code (/server/dist/*.mjs)
Three different Grunt build tasks are available:
- l4w-build-pipeline (default, builds both server and client, with production mode)
- l4w-build-client (faster, builds only the client, with development mode)
- l4w-build-server (faster, builds only the server, with development mode)
Every commit on Master branch trigger a GitHub Action. The build process will call the Grunt script, and then a shell script which will commit the build output to the "deploy" branch of the GitHub repository.
Grunt will perform these tasks:
- Run ESLint, a static analysis tool for code quality
- Run TSC, the TypeScript compiler, producing many .js files for the server
- Rename the server-side files, changing extensions from .js to .mjs
- Run WebPack, for compiling the client into a dedicated js for every page (Game, Mapper, Tilesetter, Tester) with a source map
- Run Babel, in order to convert the client-side files to ES5, producing l4w-*.es5.js
- Uglify the client-side file, producing l4w-*.min.js
The shell script will take the local repo modified by Grunt, remove some files and folders which are useless for the deployed app, and push everything to the Deploy branch of the GH repo.
The Heroku app for l4w is configured to automatically deploy from the "deploy" branch. This means that after every successful build, the updated code is deployed on Heroku as a new app version.