【问题标题】:How do I run svg-editor without using node.js?如何在不使用 node.js 的情况下运行 svg-editor?
【发布时间】:2022-07-05 13:06:33
【问题描述】:

我正在尝试将https://github.com/SVG-Edit/svgedit 添加到网站。
安装说明展示了如何在 Node.js 中使用它

我被告知编辑器在没有 Node.js 的情况下也可以运行,所以我尝试克隆 repo 并将其放在文件夹 svgedit7 中的 Flask 服务器的“静态”文件夹下

如果我尝试使用
http://127.0.0.1/static/svgedit7/src/editor/index.html

访问编辑器

我收到此错误

似乎可以这样运行编辑器,但我不知道该怎么做。 看这个链接https://svgedit.netlify.app/editor/index.html

这里是加载编辑器并生成上述错误https://github.com/SVG-Edit/svgedit/blob/master/src/editor/index.html的页面源链接

我确实尝试将这些添加到我的 Flask 应用程序中,但并没有改变这种情况

import mimetypes
mimetypes.add_type('application/javascript', '.mjs')
mimetypes.add_type('application/javascript', '.js')

我在这里做错了什么?

【问题讨论】:

    标签: svg-edit


    【解决方案1】:

    回复有点晚。请按照以下步骤操作:

    1. 在您的机器上配置 npm
    2. 导航到 svgedit 的根目录。跑 $ npm 构建。
    3. 复制 dist 文件夹的内容并在任何你想要的地方使用它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-03
      • 1970-01-01
      • 1970-01-01
      • 2020-10-19
      • 2021-05-06
      • 1970-01-01
      • 1970-01-01
      • 2022-07-23
      相关资源
      最近更新 更多