-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
58 lines (57 loc) · 1.82 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
48
49
50
51
52
53
54
55
56
57
58
import postcss from './postcss.config.cjs';
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import sveltePreprocess from 'svelte-preprocess';
import path from 'path';
const IGNORED_WARNINGS = [
'a11y-autofocus',
'a11y-click-events-have-key-events',
'a11y-label-has-associated-control',
'a11y-missing-attribute',
'a11y-no-noninteractive-element-interactions',
'a11y-no-static-element-interactions',
'css-unused-selector'
];
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
svelte({
preprocess: sveltePreprocess({
scss: {
prependData: "@import 'src/styles/globals.scss';"
}
}),
onwarn(warning, handler) {
if (!IGNORED_WARNINGS.includes(warning.code)) handler(warning);
}
}),
nodePolyfills({
// To exclude specific polyfills, add them to this list.
exclude: [
'fs' // Excludes the polyfill for `fs` and `node:fs`.
],
// Whether to polyfill specific globals.
globals: {
Buffer: true, // can also be 'build', 'dev', or false
global: true,
process: true
},
// Whether to polyfill `node:` protocol imports.
protocolImports: true
})
],
css: {
postcss
},
resolve: {
alias: {
'@': path.resolve('/src'),
$src: path.resolve('./src'),
$lib: path.resolve('./src/lib'),
$stores: path.resolve('./src/stores'),
$components: path.resolve('./src/components')
}
},
base: 'https://fortyseven.github.io/chit/'
});