refactor: unify bundled assets with subdirs and Hugo mounts

Move bundled outputs to dedicated css/js subdirs. Update Vite
config to output directly to bundled/ with simplified naming.
Add Hugo module mounts to expose as assets/bundled and
static/bundled. Adjust gitignore and partial accordingly.

Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
Sped0n
2025-11-14 18:09:51 +08:00
committed by Ryan
parent 2e7131a5a5
commit 268159e7d2
14 changed files with 26 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ import solidPlugin from 'vite-plugin-solid'
export default defineConfig({
plugins: [solidPlugin()],
build: {
outDir: './',
outDir: './bundled',
watch: process.env.DISABLE_WATCH
? null
: {
@@ -17,15 +17,9 @@ export default defineConfig({
},
output: {
format: 'es',
entryFileNames: (chunkInfo) =>
chunkInfo.name === 'critical'
? 'assets/bundled/[name].js'
: 'static/bundled/js/[name].js',
chunkFileNames: 'static/bundled/js/[hash:6].js',
assetFileNames: (assetInfo) =>
assetInfo.names[0]?.startsWith('critical')
? 'assets/bundled/[name].[ext]'
: 'static/bundled/[ext]/[name].[ext]',
entryFileNames: 'js/[name].js',
chunkFileNames: 'js/[hash:6].js',
assetFileNames: '[ext]/[name].[ext]',
compact: true
}
}