-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
33 lines (30 loc) · 844 Bytes
/
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import monaco from 'vite-plugin-monaco-editor'
import { resolve } from 'path'
// https://github.com/vdesjs/vite-plugin-monaco-editor/issues/21
const isObjectWithDefaultFunction = (module: unknown): module is { default: typeof monaco } => (
module != null &&
typeof module === 'object' &&
'default' in module &&
typeof module.default === 'function'
)
const monacoEditorPlugin = isObjectWithDefaultFunction(monaco)
? monaco.default
: monaco
export default defineConfig({
plugins: [
vue(),
monacoEditorPlugin({
languageWorkers: ['json', 'editorWorkerService'],
}),
],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
server: {
host: true
}
})