diff --git a/CHANGELOG.md b/CHANGELOG.md index 290c3c3bccd6b56ba8f3799684049075f842ee09..2f56da0cc48b793151da0989695b842bc122b5e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -* +* Made part of the frontend code conditional on `NODE_ENV = "development"` ### Fixed diff --git a/frontends/web/package.json b/frontends/web/package.json index 7449e901dd1784a7b377c8e85c52b8f346c88f10..915278fac97937c31d78e7700cf2a82f57772ea5 100644 --- a/frontends/web/package.json +++ b/frontends/web/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "scripts": { - "build": "parcel build index.html", + "build": "NODE_ENV=production parcel build index.html", "dev": "parcel index.html", "lint": "eslint .", "nodemon": "nodemon --exec \"parcel --no-cache index.html\"", @@ -19,10 +19,11 @@ "source": "index.ts", "devDependencies": { "@parcel/transformer-typescript-tsc": "^2.10.3", + "@types/node": "^20.10.6", "@types/react": "^18.2.46", "@types/react-dom": "^18.2.18", - "@typescript-eslint/eslint-plugin": "^6.16.0", - "@typescript-eslint/parser": "^6.16.0", + "@typescript-eslint/eslint-plugin": "^6.17.0", + "@typescript-eslint/parser": "^6.17.0", "buffer": "^6.0.3", "emukit": "^0.9.4", "eslint": "^8.56.0", diff --git a/frontends/web/ts/gb.ts b/frontends/web/ts/gb.ts index a7a5a68ee9f9e04b85b14bfd0da476817cbebd53..c37cc617c8995b732006f997635da148de27b950 100644 --- a/frontends/web/ts/gb.ts +++ b/frontends/web/ts/gb.ts @@ -543,17 +543,20 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { } get sections(): SectionInfo[] { - return [ + const _sections: SectionInfo[] = [ { name: "Serial", icon: require("../res/serial.svg"), node: SerialSection({ emulator: this }) - }, - { - name: "Test", - node: TestSection({}) } ]; + if (process.env.NODE_ENV === "development") { + _sections.push({ + name: "Test", + node: TestSection({}) + }); + } + return _sections; } get help(): HelpPanel[] {