generated from ShayanTheNerd/budgetly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mjs
44 lines (42 loc) · 1.85 KB
/
vite.config.mjs
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
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import Unimport from 'unimport/unplugin';
import { fileURLToPath, URL } from 'node:url';
/* prettier-ignore */
const standardHTMLTags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'search', 'section', 'select', 'slot', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', 'svg', 'path'];
export default defineConfig({
plugins: [
Unimport.vite({ presets: ['vue', 'pinia'] }),
vue({
template: {
compilerOptions: {
/* Bypass the dev-only console warning for the “search” native HTML element. */
isNativeTag: tagName => standardHTMLTags.includes(tagName),
},
},
}),
],
server: {
open: true,
port: '3000',
host: '127.0.0.1',
},
preview: {
open: true,
port: '8080',
host: '127.0.0.1',
},
define: {
__VUE_OPTIONS_API__: false,
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
esbuild: {
supported: {
'top-level-await': true, // Target the build for browsers that support top-level “await” in modules
},
},
});