-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.js
More file actions
37 lines (35 loc) · 1.07 KB
/
Copy pathvite.config.js
File metadata and controls
37 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig } from 'vite'
/*
* The game is plain ES modules, so vite needs no plugins - it is here for
* two things only:
*
* - dev: serve the source files with sane cache headers, no build step
* - build: one content hashed bundle plus hashed assets, so a deploy can
* never be picked up half old and half new
*/
export default defineConfig({
/* relative URLs, so dist/ can be dropped into any subdirectory
(http://host/p4/) and not just a domain root */
base: './',
server: {
/* listen on the LAN too, so phones and tablets can reach it */
host: true,
port: 8000,
/* never let a stale module survive a reload while developing */
headers: { 'Cache-Control': 'no-store' },
},
build: {
outDir: 'dist',
/* one chunk, no dynamic imports, so there is nothing to preload
and the polyfill would be dead weight */
modulePreload: { polyfill: false },
emptyOutDir: true,
assetsInlineLimit: 0,
rollupOptions: {
output: {
entryFileNames: 'assets/[name].[hash].js',
assetFileNames: 'assets/[name].[hash][extname]',
},
},
},
})