mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 22:59:10 +00:00
1ab06a86fc
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
37 lines
642 B
JavaScript
37 lines
642 B
JavaScript
import path from 'node:path'
|
|
import { defineConfig } from 'vite'
|
|
|
|
const BASE = '/base/'
|
|
|
|
export default defineConfig({
|
|
base: BASE,
|
|
build: {
|
|
rollupOptions: {
|
|
input: {
|
|
main: path.resolve(__dirname, 'src/index.html'),
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
fs: {
|
|
strict: true,
|
|
allow: [path.resolve(__dirname, 'src')],
|
|
},
|
|
hmr: {
|
|
overlay: false,
|
|
},
|
|
headers: {
|
|
'x-served-by': 'vite',
|
|
},
|
|
},
|
|
preview: {
|
|
headers: {
|
|
'x-served-by': 'vite',
|
|
},
|
|
},
|
|
define: {
|
|
ROOT: JSON.stringify(path.dirname(__dirname).replace(/\\/g, '/')),
|
|
BASE: JSON.stringify(BASE),
|
|
},
|
|
})
|