mirror of
https://github.com/vitejs/vite.git
synced 2024-11-22 07:09:05 +00:00
23 lines
633 B
JavaScript
23 lines
633 B
JavaScript
import { defineConfig } from 'vite'
|
|
import baseConfig from './vite.config.js'
|
|
|
|
export default defineConfig(({ isPreview }) => ({
|
|
...baseConfig,
|
|
base: !isPreview ? './' : '/relative-base/', // relative base to make dist portable
|
|
build: {
|
|
...baseConfig.build,
|
|
outDir: 'dist/relative-base',
|
|
watch: null,
|
|
minify: false,
|
|
assetsInlineLimit: 0,
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: 'entries/[name].js',
|
|
chunkFileNames: 'chunks/[name]-[hash].js',
|
|
assetFileNames: 'other-assets/[name]-[hash][extname]',
|
|
},
|
|
},
|
|
},
|
|
cacheDir: 'node_modules/.vite-relative-base',
|
|
}))
|