/
vite.config.js
33 lines (32 loc) · 981 Bytes
/
vite.config.js
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
import { defineConfig } from 'vite'
import transformFooWithInlineSourceMap from './foo-with-sourcemap-plugin'
import { transformZooWithSourcemapPlugin } from './zoo-with-sourcemap-plugin'
export default defineConfig({
plugins: [
transformFooWithInlineSourceMap(),
transformZooWithSourcemapPlugin(),
],
build: {
sourcemap: true,
rollupOptions: {
output: {
manualChunks(name) {
if (name.endsWith('after-preload-dynamic.js')) {
return 'after-preload-dynamic'
}
if (name.endsWith('after-preload-dynamic-hashbang.js')) {
return 'after-preload-dynamic-hashbang'
}
if (name.endsWith('after-preload-dynamic-no-dep.js')) {
return 'after-preload-dynamic-no-dep'
}
},
banner(chunk) {
if (chunk.name.endsWith('after-preload-dynamic-hashbang')) {
return '#!/usr/bin/env node'
}
},
},
},
},
})