{"id":14963924,"url":"https://github.com/phaserjs/template-bun","last_synced_at":"2025-10-19T08:32:11.338Z","repository":{"id":240960931,"uuid":"800637880","full_name":"phaserjs/template-bun","owner":"phaserjs","description":"A Phaser 3 project template that uses Bun for bundling","archived":false,"fork":false,"pushed_at":"2024-11-14T14:48:07.000Z","size":709,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T11:11:23.138Z","etag":null,"topics":["bun","canvas","games","phaser","phaser3","typescript","vite","webgl"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phaserjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-14T17:55:51.000Z","updated_at":"2024-12-18T11:18:38.000Z","dependencies_parsed_at":"2024-05-21T17:29:26.406Z","dependency_job_id":"d480560d-ead7-4579-ac76-208c0ba9637e","html_url":"https://github.com/phaserjs/template-bun","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"f8940b191db1d53b2f27d48859eaa8cd72d7e605"},"previous_names":["phaserjs/template-bun"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaserjs%2Ftemplate-bun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaserjs%2Ftemplate-bun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaserjs%2Ftemplate-bun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaserjs%2Ftemplate-bun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phaserjs","download_url":"https://codeload.github.com/phaserjs/template-bun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237092908,"owners_count":19254304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","canvas","games","phaser","phaser3","typescript","vite","webgl"],"created_at":"2024-09-24T13:32:20.038Z","updated_at":"2025-10-19T08:32:11.332Z","avatar_url":"https://github.com/phaserjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phaser Bun TypeScript Template\n\nThis is a Phaser 3 project template that uses Vite and Bun for bundling. It supports hot-reloading for quick development workflow, includes TypeScript support and scripts to generate production-ready builds.\n\n### Versions\n\nThis template has been updated for:\n\n- [Phaser 3.90.0](https://github.com/phaserjs/phaser)\n- [Vite 6.3.1](https://github.com/vitejs/vite)\n- [TypeScript 5.7.2](https://github.com/microsoft/TypeScript)\n\n![screenshot](screenshot.png)\n\n## Requirements\n\n[Bun](https://bun.sh) is required to install dependencies and run scripts via `bun`.\n\n## Available Commands\n\n| Command | Description |\n|---------|-------------|\n| `bun install` | Install project dependencies |\n| `bun run dev` | Launch a development web server |\n| `bun run build` | Create a production build in the `dist` folder |\n| `bun run dev-nolog` | Launch a development web server without sending anonymous data (see \"About log.js\" below) |\n| `bun run build-nolog` | Create a production build in the `dist` folder without sending anonymous data (see \"About log.js\" below) |\n\n## Writing Code\n\nAfter cloning the repo, run `bun install` from your project directory. Then, you can start the local development server by running `bun run dev`.\n\nThe local development server runs on `http://localhost:8080` by default. Please see the Vite documentation if you wish to change this, or add SSL support.\n\nOnce the server is running you can edit any of the files in the `src` folder. Vite will automatically recompile your code and then reload the browser.\n\n## Template Project Structure\n\nWe have provided a default project structure to get you started. This is as follows:\n\n| Path                         | Description                                                |\n|------------------------------|------------------------------------------------------------|\n| `index.html`                 | A basic HTML page to contain the game.                     |\n| `public/assets`              | Game sprites, audio, etc. Served directly at runtime.      |\n| `public/style.css`           | Global layout styles.                                      |\n| `src/game`                   | Folder containing the game code.                           |\n| `src/main.ts`                | Application bootstrap.                                     |\n| `src/game/main.ts`           | Game entry point: configures and starts the game.          |\n| `src/game/scenes`            | Folder with all Phaser game scenes.                        |\n\n## Handling Assets\n\nVite supports loading assets via JavaScript module `import` statements.\n\nThis template provides support for both embedding assets and also loading them from a static folder. To embed an asset, you can import it at the top of the JavaScript file you are using it in:\n\n```js\nimport logoImg from './assets/logo.png'\n```\n\nTo load static files such as audio files, videos, etc place them into the `public/assets` folder. Then you can use this path in the Loader calls within Phaser:\n\n```js\npreload ()\n{\n    //  This is an example of an imported bundled image.\n    //  Remember to import it at the top of this file\n    this.load.image('logo', logoImg);\n\n    //  This is an example of loading a static image\n    //  from the public/assets folder:\n    this.load.image('background', 'assets/bg.png');\n}\n```\n\nWhen you issue the `bun run build` command, all static assets are automatically copied to the `dist/assets` folder.\n\n## Deploying to Production\n\nAfter you run the `bun run build` command, your code will be built into a single bundle and saved to the `dist` folder, along with any other assets your project imported, or stored in the public assets folder.\n\nIn order to deploy your game, you will need to upload *all* of the contents of the `dist` folder to a public facing web server.\n\n## Customizing the Template\n\n### Vite\n\nIf you want to customize your build, such as adding plugin (i.e. for loading CSS or fonts), you can modify the `vite/config.*.mjs` file for cross-project changes, or you can modify and/or create new configuration files and target them in specific bun tasks inside of `package.json`. Please see the [Vite documentation](https://vitejs.dev/) for more information.\n\n## About log.js\n\nIf you inspect our node scripts you will see there is a file called `log.js`. This file makes a single silent API call to a domain called `gryzor.co`. This domain is owned by Phaser Studio Inc. The domain name is a homage to one of our favorite retro games.\n\nWe send the following 3 pieces of data to this API: The name of the template being used (vue, react, etc). If the build was 'dev' or 'prod' and finally the version of Phaser being used.\n\nAt no point is any personal data collected or sent. We don't know about your project files, device, browser or anything else. Feel free to inspect the `log.js` file to confirm this.\n\nWhy do we do this? Because being open source means we have no visible metrics about which of our templates are being used. We work hard to maintain a large and diverse set of templates for Phaser developers and this is our small anonymous way to determine if that work is actually paying off, or not. In short, it helps us ensure we're building the tools for you.\n\nHowever, if you don't want to send any data, you can use these commands instead:\n\nDev:\n\n```bash\nbun run dev-nolog\n```\n\nBuild:\n\n```bash\nbun run build-nolog\n```\n\nOr, to disable the log entirely, simply delete the file `log.js` and remove the call to it in the `scripts` section of `package.json`:\n\nBefore:\n\n```json\n\"scripts\": {\n    \"dev\": \"bun log.js dev \u0026 bunx --bun vite --config vite/config.dev.mjs\",\n    \"build\": \"bun log.js build \u0026 bunx --bun vite build --config vite/config.prod.mjs\"\n},\n```\n\nAfter:\n\n```json\n\"scripts\": {\n    \"dev\": \"bunx --bun vite --config vite/config.dev.mjs\",\n    \"build\": \"bunx --bun vite build --config vite/config.prod.mjs\"\n},\n```\n\nEither of these will stop `log.js` from running. If you do decide to do this, please could you at least join our Discord and tell us which template you're using! Or send us a quick email. Either will be super-helpful, thank you.\n\n## Join the Phaser Community!\n\nWe love to see what developers like you create with Phaser! It really motivates us to keep improving. So please join our community and show-off your work 😄\n\n**Visit:** The [Phaser website](https://phaser.io) and follow on [Phaser Twitter](https://twitter.com/phaser_)\u003cbr /\u003e\n**Play:** Some of the amazing games [#madewithphaser](https://twitter.com/search?q=%23madewithphaser\u0026src=typed_query\u0026f=live)\u003cbr /\u003e\n**Learn:** [API Docs](https://newdocs.phaser.io), [Support Forum](https://phaser.discourse.group/) and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)\u003cbr /\u003e\n**Discord:** Join us on [Discord](https://discord.gg/phaser)\u003cbr /\u003e\n**Code:** 2000+ [Examples](https://labs.phaser.io)\u003cbr /\u003e\n**Read:** The [Phaser World](https://phaser.io/community/newsletter) Newsletter\u003cbr /\u003e\n\nCreated by [Phaser Studio](mailto:support@phaser.io). Powered by coffee, anime, pixels and love.\n\nThe Phaser logo and characters are \u0026copy; 2011 - 2025 Phaser Studio Inc.\n\nAll rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaserjs%2Ftemplate-bun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphaserjs%2Ftemplate-bun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaserjs%2Ftemplate-bun/lists"}