简体   繁体   English

vue 的 Monaco 编辑器生成大量.js 文件

[英]Monaco editor for vue generates lots of .js files

I am implementing vue-monaco plugin inside Laravel application using Vue.我正在使用 Vue 在 Laravel 应用程序中实现 vue-monaco 插件。

The steps are rather easy, I install the vue-monaco like:步骤相当简单,我安装vue-monaco如下:

npm install vue-monaco

Then in my Vue file I import the monaco editor like:然后在我的 Vue 文件中,我导入了 monaco 编辑器,例如:

import MonacoEditor from 'vue-monaco'

I don't even use it, just import it and then run npm run watch .我什至不使用它,只是导入它然后运行npm run watch This result in npm creating exactly 63 files in my public folder, like in the image below (first 15 are shown, 63 are being created).这导致 npm 在我的公用文件夹中创建了 63 个文件,如下图所示(显示了前 15 个,正在创建 63 个)。

Why does this happen and how can I bypass it?为什么会发生这种情况,我该如何绕过它?

在此处输入图像描述

vue-monaco is basically a VScode in your webview, right? vue-monaco基本上是你 webview 中的 VScode,对吧? If it's the case, it's probably creating some configuration files for it to work and this is totally normal.如果是这种情况,它可能正在创建一些配置文件以使其工作,这是完全正常的。

What's the content of those files and the content of your package.json ( npm run watch )?这些文件的内容和您的package.jsonnpm run watch )的内容是什么?

If you want to custom some options for this plugin, it looks like that you will need to dive into those settings: https://microsoft.github.io/monaco-editor/api/modules/monaco.editor.html#create and pass it as props to vue-monaco (this info is taken from the doc itself).如果您想为此插件自定义一些选项,看起来您需要深入了解这些设置: https://microsoft.github.io/monaco-editor/api/modules/monaco.editor.html#create和将其作为道具传递给vue-monaco (此信息取自文档本身)。

Otherwise, creating a simple vue project can help debug things too IMO, see if the files are created in public too or if it's more of a laravel configuration issue.否则,创建一个简单的 vue 项目也可以帮助调试 IMO,看看这些文件是否也是公开创建的,或者它是否更像是laravel配置问题。 Then, you could maybe try the github issue of the main JS project: https://github.com/microsoft/monaco-editor/issues?q=is%3Aissue然后,您可以尝试主 JS 项目的 github 问题: https://github.com/microsoft/monaco-editor/issues?q=is%3Aissue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM