-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.lib.config.ts
40 lines (38 loc) · 989 Bytes
/
vite.lib.config.ts
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
38
39
import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy'
import license from 'rollup-plugin-license'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
legacy({
targets: ['defaults', 'not IE 11'],
}),
],
experimental: {
renderBuiltUrl(filename: string, { hostType }: { hostType: 'js' | 'css' | 'html' }) {
if (hostType === 'js') {
return { runtime: `window.__monaco_component_base(${JSON.stringify(filename)})` }
} else {
return { relative: true }
}
}
},
build: {
rollupOptions: {
plugins: [
license({
thirdParty: {
output: path.resolve(__dirname, './dist/LICENSE.txt'),
},
}),
],
output: {
entryFileNames: "[name].js",
// chunkFileNames: "zzz-[name].js",
// this got rid of the hash on style.css
assetFileNames: "[name].[ext]",
},
},
},
})