From 9da64d283ff4e1fc5b1f8b1ad0f54fde33484111 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 10 Jan 2024 18:11:11 -0500 Subject: [PATCH] chore(examples): add vite example --- examples/vite/.gitignore | 24 ++++++++++++++++++++++++ examples/vite/.npmrc | 1 + examples/vite/index.html | 12 ++++++++++++ examples/vite/package.json | 18 ++++++++++++++++++ examples/vite/src/main.tsx | 11 +++++++++++ examples/vite/src/vite-env.d.ts | 1 + examples/vite/tsconfig.json | 23 +++++++++++++++++++++++ 7 files changed, 90 insertions(+) create mode 100644 examples/vite/.gitignore create mode 100644 examples/vite/.npmrc create mode 100644 examples/vite/index.html create mode 100644 examples/vite/package.json create mode 100644 examples/vite/src/main.tsx create mode 100644 examples/vite/src/vite-env.d.ts create mode 100644 examples/vite/tsconfig.json diff --git a/examples/vite/.gitignore b/examples/vite/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/examples/vite/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/examples/vite/.npmrc b/examples/vite/.npmrc new file mode 100644 index 00000000..43c97e71 --- /dev/null +++ b/examples/vite/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/examples/vite/index.html b/examples/vite/index.html new file mode 100644 index 00000000..2097d2ff --- /dev/null +++ b/examples/vite/index.html @@ -0,0 +1,12 @@ + + + + + + phaser-jsx + + +
+ + + diff --git a/examples/vite/package.json b/examples/vite/package.json new file mode 100644 index 00000000..d6dd8f27 --- /dev/null +++ b/examples/vite/package.json @@ -0,0 +1,18 @@ +{ + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "start": "vite --open --force" + }, + "dependencies": { + "phaser": "^3.70.0" + }, + "devDependencies": { + "typescript": "^5.2.2", + "vite": "^5.0.8" + }, + "license": "MIT" +} diff --git a/examples/vite/src/main.tsx b/examples/vite/src/main.tsx new file mode 100644 index 00000000..d150f145 --- /dev/null +++ b/examples/vite/src/main.tsx @@ -0,0 +1,11 @@ +import Phaser from 'phaser'; + +import { render, Text } from '../../../src'; + +new Phaser.Game({ + scene: { + create() { + render(, this); + }, + }, +}); diff --git a/examples/vite/src/vite-env.d.ts b/examples/vite/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/examples/vite/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vite/tsconfig.json b/examples/vite/tsconfig.json new file mode 100644 index 00000000..2cd3e667 --- /dev/null +++ b/examples/vite/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + + "jsx": "react-jsx" + }, + "include": ["src"] +}