vite/playground/fs-serve/root/vite.config-base.js
Xinxin He 1ab06a86fc
fix(importAnalysis): strip url base before passing as safeModulePaths (#13712)
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
2023-07-29 20:28:40 +02:00

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),
},
})