phaser-quick vite plugins
Overview
A collection of useful vite plugins for Phaser development. Checkout the main phaser-quick repo for more easy to use packages.
1. Build Information
This plugin provides additional build information in JSON format and exposes this to dist/assets/version.json
. See below for a sample output.
1.1. Usage
1.1.1. Installation
npm i @phaser-quick/vite-plugins
1.1.2. Example
import { getBuildInfo } from '@phaser-quick/vite-plugins';
export default {
//...
plugins: [getBuildInfo()]
};
1.1.3. Output
// dist/assets/version.json
{
"commit": "47075e6b91b7e4b7be3e8bed94eb00bb0075f68c",
"buildTimestamp": "2023-10-25T19:17:19.876Z",
"dependencies": {
"phaser": "3.60.0",
"phaser-quick": "0.0.27"
}
}
1.2. Options
1.2.1. outputDir
Changes the output directory of the version.json file relative to the dist. Default value is assets/
.
1.2.1.1. Usage
export default {
//...
plugins: [getBuildInfo({ outputDir: 'assets/info' })]
};
// expected output location: dist/assets/info/version.json
1.2.2. dependencies
Specifies the dependencies to output. Default value is ['phaser','phaser-quick']
.
1.2.2.1. Usage
export default {
//...
plugins: [getBuildInfo({ dependencies: 'my-package' })]
};
// expected output:
{
"commit": "47075e6b91b7e4b7be3e8bed94eb00bb0075f68c",
"buildTimestamp": "2023-10-25T19:17:19.876Z",
"dependencies": {
"my-package": "1.0.0"
}
}