-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vue-playground): build error, remove monaco workers
- Loading branch information
1 parent
1707879
commit ad261f8
Showing
7 changed files
with
66 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,45 @@ | ||
import {createSingletonPromise, SingletonPromiseReturn} from '@vueuse/core' | ||
|
||
export const loadWorkers = createSingletonPromise(async () => { | ||
return await Promise.all([ | ||
// load workers | ||
(async () => { | ||
const [ | ||
{default: EditorWorker}, | ||
{default: JsonWorker}, | ||
{default: HtmlWorker}, | ||
{default: TsWorker}, | ||
{default: CssWorker} | ||
] = await Promise.all([ | ||
import('monaco-editor/esm/vs/editor/editor.worker?worker'), | ||
import('monaco-editor/esm/vs/language/json/json.worker?worker'), | ||
import('monaco-editor/esm/vs/language/html/html.worker?worker'), | ||
import('monaco-editor/esm/vs/language/typescript/ts.worker?worker'), | ||
import('monaco-editor/esm/vs/language/css/css.worker?worker') | ||
]) | ||
return Promise.resolve() | ||
// return await Promise.all([ | ||
// // load workers | ||
// (async () => { | ||
// const [ | ||
// {default: EditorWorker}, | ||
// {default: JsonWorker}, | ||
// {default: HtmlWorker}, | ||
// {default: TsWorker}, | ||
// {default: CssWorker} | ||
// ] = await Promise.all([ | ||
// import('monaco-editor/esm/vs/editor/editor.worker?worker'), | ||
// import('monaco-editor/esm/vs/language/json/json.worker?worker'), | ||
// import('monaco-editor/esm/vs/language/html/html.worker?worker'), | ||
// import('monaco-editor/esm/vs/language/typescript/ts.worker?worker'), | ||
// import('monaco-editor/esm/vs/language/css/css.worker?worker') | ||
// ]) | ||
|
||
self.MonacoEnvironment = { | ||
getWorker: function (workerId, label) { | ||
switch (label) { | ||
case 'json': | ||
return new JsonWorker() | ||
case 'css': | ||
case 'scss': | ||
case 'less': | ||
return new CssWorker() | ||
case 'html': | ||
case 'handlebars': | ||
case 'razor': | ||
return new HtmlWorker() | ||
case 'typescript': | ||
case 'javascript': | ||
return new TsWorker() | ||
default: | ||
return new EditorWorker() | ||
} | ||
} | ||
} | ||
})() | ||
]) | ||
// self.MonacoEnvironment = { | ||
// getWorker: function (workerId, label) { | ||
// switch (label) { | ||
// case 'json': | ||
// return new JsonWorker() | ||
// case 'css': | ||
// case 'scss': | ||
// case 'less': | ||
// return new CssWorker() | ||
// case 'html': | ||
// case 'handlebars': | ||
// case 'razor': | ||
// return new HtmlWorker() | ||
// case 'typescript': | ||
// case 'javascript': | ||
// return new TsWorker() | ||
// default: | ||
// return new EditorWorker() | ||
// } | ||
// } | ||
// } | ||
// })() | ||
// ]) | ||
}) as SingletonPromiseReturn<unknown> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ad261f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for vue-superman ready!
✅ Preview
https://vue-superman-iligbiho4-2214962083.vercel.app
Built with commit ad261f8.
This pull request is being automatically deployed with vercel-action