rename demo to website

This commit is contained in:
“chrisshank” 2024-12-17 23:56:46 -08:00
parent 82f8c36da6
commit c0784f6277
61 changed files with 5 additions and 5 deletions

View File

@ -15,5 +15,5 @@
"lib": ["DOM", "DOM.Iterable", "ESNext", "WebWorker"], "lib": ["DOM", "DOM.Iterable", "ESNext", "WebWorker"],
"types": ["@webgpu/types", "@types/node", "bun-types"] "types": ["@webgpu/types", "@types/node", "bun-types"]
}, },
"include": ["lib/**/*.ts", "demo/**/*.ts", "vite.config.ts"] "include": ["lib/**/*.ts", "website/**/*.ts", "vite.config.ts"]
} }

View File

@ -2,10 +2,10 @@ import { resolve } from 'node:path';
import { readdirSync } from 'node:fs'; import { readdirSync } from 'node:fs';
import { defineConfig, IndexHtmlTransformContext, Plugin } from 'vite'; import { defineConfig, IndexHtmlTransformContext, Plugin } from 'vite';
const demoDir = resolve(__dirname, 'demo'); const websiteDir = resolve(__dirname, 'website');
function getFiles() { function getFiles() {
return readdirSync(demoDir).filter((file) => file.endsWith('.html')); return readdirSync(websiteDir).filter((file) => file.endsWith('.html'));
} }
const linkGenerator = (): Plugin => { const linkGenerator = (): Plugin => {
@ -64,13 +64,13 @@ const linkGenerator = (): Plugin => {
}; };
export default defineConfig({ export default defineConfig({
root: 'demo', root: 'website',
plugins: [linkGenerator()], plugins: [linkGenerator()],
build: { build: {
target: 'esnext', target: 'esnext',
rollupOptions: { rollupOptions: {
input: getFiles().reduce((acc, file) => { input: getFiles().reduce((acc, file) => {
acc[file.replace('.html', '')] = resolve(demoDir, file); acc[file.replace('.html', '')] = resolve(websiteDir, file);
return acc; return acc;
}, {} as Record<string, string>), }, {} as Record<string, string>),
}, },