forked from martin-pabst/SQL-IDE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config-embedded.ts
More file actions
32 lines (30 loc) · 1.02 KB
/
vite.config-embedded.ts
File metadata and controls
32 lines (30 loc) · 1.02 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
import type { UserConfig } from 'vite'
import commonConfig from './vite.config-common.ts'
export default {
...commonConfig,
base: '',
build: {
sourcemap: true,
rollupOptions: {
input: {
embedded: './embedded.html'
},
output: {
entryFileNames: _assetInfo => {
return 'sql-ide-embedded.js'; // im Hauptverzeichnis
},
assetFileNames: assetInfo => assetInfo.name?.endsWith('css') ? 'sql-ide-embedded.css' : 'assets/[name]-[hash][extname]',
manualChunks: (id: string, { getModuleInfo, getModuleIds }) => {
if (id.endsWith('.css')) {
return 'css';
}
if (id.includes('node_modules')) return id.toString().split('node_modules/')[1].split('/')[0].toString().replace("@", "");
// 'everything' - jetzt entstehen nur 1 CSS Asset, 1 JS Assert, plus 1 Worker JS Assets.
return 'own_sourcecode';
},
}
},
outDir: './dist-embedded',
chunkSizeWarningLimit: 4912,
}
} satisfies UserConfig;