@bit74/pdql-autocomplete-standalone
v0.1.18
Published
Текущая сборка собрана с помощью custom-webpack-config. ~~Есть [хак, как собрать версию без кастомизации на esbuild](https://github.com/microsoft/monaco-editor/issues/886#issuecomment-1804332159)~~
Downloads
1,035
Readme
Pdql Autocomplete
Текущая сборка собрана с помощью custom-webpack-config.
~~Есть хак, как собрать версию без кастомизации на esbuild~~
~~Дублирую сюда:~~
~~В папке проекта выполнить npx replace "^import '.*\.css';$" "" --recursive ./node_modules/monaco-editor/esm/*
~~
~~В секцию styles
в angular.json
добавить node_modules/monaco-editor/min/vs/editor/editor.main.css
~~
~~На данный момент такая сборка тоже не работает в продакшене. По крайней мере, у меня не получилось.~~
Проблема веб-воркеров
Monaco запрашивает воркеры по http, и запросы залетают в основной бандл, где воркеров,
собственно, нет. На данный момент решается закидыванием необходимых воркеров в папку assets.
Настроен webpack.config.ts
с префиксом assets.
Т.к. редактор используется в очень лайтовом режиме, скорее всего, отсутствие воркеров, как таковое, не повлияет на производительность интерфейса. Но, все же, имеет смысл подумать о решении проблемы (в открытых источниках решение найти не удалось)
Оптимальным решением видится включение воркеров в бандл редактора. Пробовал решение через
дополнительное правило webpack.config для загрузки .worker.js
с помощью worker-loader
,
но это решение ломает сборку.
Еще один вариант решения - импорт напрямую внутри компонента
https://webpack.js.org/guides/web-workers
https://github.com/microsoft/monaco-editor/issues/2605
При таком решении webpack пытается загрузить файлы напрямую, что вызывает ошибку cors и блокируется
This project was generated with Angular CLI version 16.2.12.
Development server
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Code scaffolding
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Build
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Running unit tests
Run ng test
to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.