fix multipage build

This commit is contained in:
“chrisshank” 2024-11-01 21:21:20 -07:00
parent 321ecd7364
commit 5168fa1d68
3 changed files with 29 additions and 8 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
dist
.vite
node_modules
.DS_Store

View File

@ -52,13 +52,13 @@
height: 100%;
}
spatial-geometry {
fc-geometry {
background: rgb(187, 178, 178);
box-shadow: rgba(0, 0, 0, 0.2) 1.95px 1.95px 2.6px;
transition: scale 100ms ease-out, box-shadow 100ms ease-out;
}
spatial-geometry:state(move) {
fc-geometry:state(move) {
scale: 1.05;
box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}
@ -69,16 +69,16 @@
</style>
</head>
<body>
<spatial-geometry x="100" y="100" width="50" height="50"></spatial-geometry>
<spatial-geometry x="100" y="200" width="50" height="50"></spatial-geometry>
<spatial-geometry x="100" y="300" width="50" height="50"></spatial-geometry>
<fc-geometry x="100" y="100" width="50" height="50"></fc-geometry>
<fc-geometry x="100" y="200" width="50" height="50"></fc-geometry>
<fc-geometry x="100" y="300" width="50" height="50"></fc-geometry>
<script type="module">
import { SpatialGeometry } from '../src/canvas/spatial-geometry.ts';
import { FolkGeometry } from '../src/canvas/fc-geometry.ts';
SpatialGeometry.register();
FolkGeometry.register();
const geos = document.querySelectorAll('spatial-geometry');
const geos = document.querySelectorAll('fc-geometry');
geos.forEach((el, i) => (el.style.viewTransitionName = `b${i}`));

20
demo/vite.config.ts Normal file
View File

@ -0,0 +1,20 @@
import { resolve } from 'node:path';
import { readdirSync } from 'node:fs';
import { defineConfig } from 'vite';
export default defineConfig({
build: {
target: 'esnext',
rollupOptions: {
input: readdirSync(__dirname)
.filter((file) => file.endsWith('.html'))
.reduce((acc, file) => {
acc[file.replace('.html', '')] = resolve(__dirname, file);
return acc;
}, {} as Record<string, string>),
},
modulePreload: {
polyfill: false,
},
},
});