-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathvite.config.ts
42 lines (41 loc) · 994 Bytes
/
vite.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
40
41
42
import { qwikVite } from '@builder.io/qwik/optimizer';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
export default defineConfig(() => {
return {
build: {
minify: false,
target: 'es2022',
outDir: 'lib',
lib: {
entry: ['./src/index.ts'],
formats: ['es'],
fileName: (format) => `index.qwik.${format === 'es' ? 'mjs' : 'cjs'}`,
},
rollupOptions: {
external: (id) => {
if (
['@builder.io/qwik', '@builder.io/qwik-city', '@builder.io/qwik/build'].includes(id)
) {
return true;
}
if (id.endsWith('worker.js?worker&url')) {
return true;
}
return false;
},
},
},
plugins: [
qwikVite(),
viteStaticCopy({
targets: [
{
src: 'src/worker.js',
dest: '.',
},
],
}),
],
};
}) as any;