-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
66 lines (61 loc) · 1.79 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
59
60
61
62
63
64
65
66
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import svgLoader from 'vite-svg-loader';
// import { ssr } from 'vite-plugin-ssr/plugin'
// const monacoPrefix = `monaco-editor/esm/vs`
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
console.log(`monacoEditorPlugin: `, monacoEditorPlugin);
console.log(`monacoEditorPlugin.default: `, monacoEditorPlugin.default);
// https://vitejs.dev/config/
export default defineConfig({
assetsInclude: [
/\.md$/,
/\.svg$/,
],
plugins: [
vue(),
// ssr({ prerender: true }),
svgLoader(),
// monacoEditorPlugin.default({languageWorkers: ['json', 'css', 'html', 'typescript']}),
],
// optimizeDeps: {
// include: [
// `${monacoPrefix}/language/json/json.worker.js`,
// `${monacoPrefix}/language/css/css.worker.js`,
// `${monacoPrefix}/language/html/html.worker.js`,
// `${monacoPrefix}/language/typescript/ts.worker.js`,
// `${monacoPrefix}/editor/editor.worker.js`,
// `${monacoPrefix}/editor/editor.api.js`,
// ]
// },
build: {
target: 'esnext',
rollupOptions: {
external: [
'fs',
'human-signals',
'execa',
'default-gateway',
'freeport-promise',
'@achingbrain/ssdp',
'@achingbrain/nat-port-mapper'
]
}
},
define: {
// 'window': 'globalThis',
},
resolve: {
alias: {
// 'monaco-editor/esm/vs/editor/editor.api': `${monacoPrefix}/editor/editor.worker.js`,
'v-tooltip': 'v-tooltip/dist/v-tooltip.esm.js',
'vue-select/es': 'node_modules/vue-select/dist/vue-select.es.js',
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
ssgOptions: {
script: 'async',
formatting: 'prettify',
},
})