diff --git a/README.md b/README.md index b021fdd..2f232a2 100644 --- a/README.md +++ b/README.md @@ -196,11 +196,16 @@ node -e "console.log(require('crypto').randomBytes(64).toString('base64'))" ### Your first build -pixel.horse has modified the Pony Town archive such that compiled game assets are no longer included. To compile the game assets for the first time, you can either use a development build with the `--sprites` flag (see [Running in development](#running-in-development)), or use the following commands to build and start a production instance with compiled sprites: +pixel.horse has modified the Pony Town archive such that compiled game assets are no longer included. To compile the game assets for the first time, you must use the following command, which will generate the necessary spritesheets and corresponding data. + +```bash +gulp sprites +``` + +If you would like to run a full production build after building spritesheets, you can use: ```bash npm run build-sprites -npm start ``` ### Production environment diff --git a/gulpfile.js b/gulpfile.js index 7cf201d..1ff359d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -321,11 +321,18 @@ const setProd = cb => { cb(); }; -const empty = cb => cb(); -const tsTools = npmScript('ts-tools'); -const spritesTask = argv.sprites ? gulp.series(tsTools, sprites) : empty; +const warnAboutTscBeingDumb = cb => { + console.log("You're probably about to see some warnings from tsc about not being bale to find certain files."); + console.log("Don't worry about these. It's a known issue regarding circular build dependencies. The build should continue despite these errors."); + cb(); +}; -const build = gulp.series(clean, setProd, spritesTask, common, ts, webpackProd, sw, size); +const empty = cb => cb(); +const tsTools = gulp.series(warnAboutTscBeingDumb, npmScript('ts-tools')); +const spritesTask = argv.sprites ? sprites : empty; +const buildSprites = gulp.series(tsTools, sprites); + +const build = gulp.series(clean, setProd, common, ts, webpackProd, sw, size); const admin = gulp.series(clearnAdmin, setProd, sassAdmin, ts, webpackAdmin); const dev = gulp.series(clean, spritesTask, common, gulp.parallel(serverDev, watch, watchTools)); @@ -334,6 +341,7 @@ module.exports = { admin, build, dev, + sprites: buildSprites, default: dev, test: watchTests, }; diff --git a/package.json b/package.json index c7d0a05..8f0a3e4 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "webpack-verbose": "npm run webpack-prod -- --verbose", "wds": "webpack-dev-server --config webpack.dev.js --progress --color --debug --port 8091", "build": "gulp build", - "build-sprites": "npm run build -- --sprites", + "build-sprites": "gulp sprites && npm run build", "build-beta": "npm run build -- --beta --tools", "build-fast": "npm run build -- --parallel", "build-maps": "npm run build -- --maps",