fix(vite): 更新monaco-editor插件配置,修复语言工作者设置
This commit is contained in:
parent
4b170fa95a
commit
c0869ddb2b
@ -23,14 +23,13 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
plugins: createVitePlugins(env, command === 'build'),
|
plugins: createVitePlugins(env, command === 'build'),
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
exclude: [
|
exclude: [
|
||||||
...(isCommonLinked ? ['@cmvr/iot-common'] : []),
|
...(isCommonLinked ? ['@cmvr/iot-common'] : [])
|
||||||
'monaco-editor',
|
|
||||||
'monaco-editor/esm/vs/base/worker/workerMain.js',
|
|
||||||
'monaco-editor/esm/vs/editor/editor.main.js',
|
|
||||||
'ts.worker.js',
|
|
||||||
'typescript'
|
|
||||||
],
|
],
|
||||||
include: [
|
include: [
|
||||||
|
'monaco-editor/esm/vs/editor/editor.all.js',
|
||||||
|
'monaco-editor/esm/vs/editor/editor.api.js',
|
||||||
|
'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js',
|
||||||
|
'monaco-editor/esm/vs/language/json/monaco.contribution.js',
|
||||||
'monaco-editor/esm/vs/language/typescript/monaco.contribution'
|
'monaco-editor/esm/vs/language/typescript/monaco.contribution'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -55,8 +54,8 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
chunkSizeWarningLimit: 2000,
|
chunkSizeWarningLimit: 2000,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
manualChunks: {
|
manualChunks(id) {
|
||||||
monaco: ['monaco-editor']
|
if (id.includes('/node_modules/monaco-editor/')) return 'monaco'
|
||||||
},
|
},
|
||||||
chunkFileNames: 'static/js/[name]-[hash].js',
|
chunkFileNames: 'static/js/[name]-[hash].js',
|
||||||
entryFileNames: 'static/js/[name]-[hash].js',
|
entryFileNames: 'static/js/[name]-[hash].js',
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export default function createVitePlugins(viteEnv, isBuild = false) {
|
|||||||
const vitePlugins = [
|
const vitePlugins = [
|
||||||
vue(),
|
vue(),
|
||||||
monacoEditorPlugin({
|
monacoEditorPlugin({
|
||||||
languages: ['javascript', 'html', 'css', 'json', 'python', 'java']
|
languageWorkers: ['editorWorkerService', 'json', 'typescript']
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
vitePlugins.push(createAutoImport())
|
vitePlugins.push(createAutoImport())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user