forked from primocms/primo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
47 lines (45 loc) · 1.25 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { sveltekit } from '@sveltejs/kit/vite';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [
sveltekit(),
// ClassMangler({
// // dev: true
// }),
// workaround for a bug in vite-plugin-ssr
{
name: 'remove-manifest',
configResolved(c) {
const manifestPlugin = c.worker.plugins.findIndex((p) => p.name === 'vite:manifest');
c.worker.plugins.splice(manifestPlugin, 1);
const ssrManifestPlugin = c.worker.plugins.findIndex(
(p) => p.name === 'vite:ssr-manifest'
);
c.plugins.splice(ssrManifestPlugin, 1);
},
apply: 'build', // or 'serve'
}
],
build: {
sourcemap: true
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
server: {
fs: {
// throws an error without this when importing Fira font
allow: ['..', 'node_modules/@fontsource/fira-code']
},
// port: 5174,
// headers: {
// 'Access-Control-Allow-Origin': '*',
// 'Access-Control-Allow-Methods': 'GET,OPTIONS,PATCH,DELETE,POST,PUT',
// 'Access-Control-Allow-Headers': 'Content-Type, Authorization',
// }
},
define: {
'__SERVER_VERSION__': JSON.stringify(process.env.npm_package_version),
}
};
export default config;