mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 18:13:54 +00:00
37 lines
795 B
TypeScript
37 lines
795 B
TypeScript
import { resolve } from 'node:path'
|
|
import { readdirSync } from 'node:fs'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import UnoCSS from 'unocss/vite'
|
|
|
|
import { DevRenderingPlugin } from './lib/dev'
|
|
import { RenderPlugin } from './lib/render'
|
|
|
|
const r = (...path: string[]) => resolve(__dirname, ...path)
|
|
|
|
export default defineConfig({
|
|
build: {
|
|
rollupOptions: {
|
|
input: {
|
|
...Object.fromEntries(
|
|
readdirSync(r('templates')).filter(dir => dir !== 'messages.json').map(dir => [
|
|
dir,
|
|
r('templates', dir, 'index.html'),
|
|
]),
|
|
),
|
|
index: r('index.html'),
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
UnoCSS(),
|
|
DevRenderingPlugin(),
|
|
RenderPlugin(),
|
|
],
|
|
server: {
|
|
fs: {
|
|
allow: ['./templates', __dirname],
|
|
},
|
|
},
|
|
})
|