HH-424: clean up Vite build warnings (#80)
Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=0" />
|
||||
<title>GoChat</title>
|
||||
<link rel="icon" type="image/png" href="/favicon-32x32.png" />
|
||||
<script src="/runtime-config.js"></script>
|
||||
<script vite-ignore src="/runtime-config.js"></script>
|
||||
</head>
|
||||
<body class="text-slate-600">
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -12,7 +12,11 @@ const assets = [...html.matchAll(/(?:href|src)="(\/assets\/[^"]+)"/g)].map(
|
||||
);
|
||||
|
||||
assert.match(html, /<div id="app"><\/div>/);
|
||||
assert.match(html, /<script src="\/runtime-config\.js"><\/script>/);
|
||||
assert.match(html, /<script\s+src="\/runtime-config\.js"><\/script>/);
|
||||
assert.ok(
|
||||
html.indexOf('/runtime-config.js') < html.indexOf('type="module"'),
|
||||
'runtime config must load before the app module'
|
||||
);
|
||||
assert.ok(
|
||||
assets.some(asset => asset.endsWith('.js')),
|
||||
'missing JS asset'
|
||||
|
||||
@@ -151,6 +151,8 @@ export default defineConfig({
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
// Dashboard is a 3 MB entry; warn only when it grows beyond that budget.
|
||||
chunkSizeWarningLimit: 3000,
|
||||
rollupOptions: {
|
||||
input: isLibraryMode ? undefined : entrypoints,
|
||||
output: {
|
||||
|
||||
Reference in New Issue
Block a user