-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.js
More file actions
36 lines (35 loc) · 779 Bytes
/
vite.config.js
File metadata and controls
36 lines (35 loc) · 779 Bytes
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
import { tsconfigPaths } from 'vite-resolve-tsconfig-paths';
// import { viteStaticCopy } from 'vite-plugin-static-copy';
export default {
plugins: [
tsconfigPaths(),
// viteStaticCopy({
// targets: [
// {
// src: 'public/images',
// dest: 'images',
// },
// ],
// }),
{
name: 'remove-type-module',
transformIndexHtml(html) {
return html.replace(
/<script type="module" crossorigin src="(\/assets\/index-[A-Za-z0-9]+\.js)"><\/script>/g,
'<script src="$1"></script>',
);
},
},
],
esbuild: {
format: 'esm',
target: 'es2022',
},
rollupOptions: {
output: {
name: 'window',
sourcemap: false,
extend: true,
},
},
};