mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
Fix a warning on start-up about freezing the UI
The console log would show "Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq" and "VM3793 simpleWorker.js:29 You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker" when loading. This is fixed by using the monaco editor webpack plugin, which ensures that the workers are loaded via async script tags.
This commit is contained in:
parent
72c80b41d0
commit
2041144f45
1 changed files with 2 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
||||||
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
|
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
|
||||||
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
||||||
const dist = path.resolve(__dirname, "dist");
|
const dist = path.resolve(__dirname, "dist");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -45,5 +46,6 @@ module.exports = {
|
||||||
new WasmPackPlugin({
|
new WasmPackPlugin({
|
||||||
crateDirectory: path.resolve(__dirname, "../../api/sixtyfps-wasm-interpreter/"),
|
crateDirectory: path.resolve(__dirname, "../../api/sixtyfps-wasm-interpreter/"),
|
||||||
}),
|
}),
|
||||||
|
new MonacoWebpackPlugin(),
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue