-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
64 lines (62 loc) · 1.84 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import vue from '@vitejs/plugin-vue';
import Components from 'unplugin-vue-components/vite';
import { BootstrapVueNextResolver } from 'bootstrap-vue-next';
import postcssNesting from 'postcss-nesting';
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 8080,
cors: false,
},
css: {
postcss: {
plugins: [postcssNesting],
},
},
plugins: [
vue(),
Components({
resolvers: [BootstrapVueNextResolver()],
}),
nodePolyfills({
// To add only specific polyfills, add them here. If no option is passed, adds all polyfills
include: ['buffer', 'crypto', 'stream', 'util'],
// To exclude specific polyfills, add them to this list. Note: if include is provided, this has no effect
exclude: [
// 'http', // Excludes the polyfill for `http` and `node:http`.
],
// Whether to polyfill specific globals.
globals: {
Buffer: true, // can also be 'build', 'dev', or false
// global: true,
// process: true,
},
// Override the default polyfills for specific modules.
overrides: {
// Since `fs` is not supported in browsers, we can use the `memfs` package to polyfill it.
// fs: 'memfs',
},
// Whether to polyfill `node:` protocol imports.
// protocolImports: true,
}),
],
define: {
global: 'window',
},
resolve: {
alias: {
// @ts-ignore-next-line
'@': fileURLToPath(new URL('./src', import.meta.url)),
crypto: 'crypto-browserify',
stream: 'stream-browserify',
util: '@browsery/util',
},
},
test: {
reporters: ['verbose', 'vitest-sonar-reporter'],
outputFile: 'sonar-report.xml',
},
});