简体   繁体   中英

How do I run svg-editor without using node.js?

I am trying to add https://github.com/SVG-Edit/svgedit to a website.
The install instructions show how to use this with Node.js

I was told that the editor would run also without Node.js so I tried to clone the repo and place it under the "static" folder of my Flask server in the folder svgedit7

If I try to access the editor using
http://127.0.0.1/static/svgedit7/src/editor/index.html

I am getting this error在此处输入图像描述

It seems that it is possible to run the editor like that but I can't figure out how to do it. See this link https://svgedit.netlify.app/editor/index.html

Here is a link to the source of the page that loads the editor and generates the above mentioned error https://github.com/SVG-Edit/svgedit/blob/master/src/editor/index.html

I did try to add these to my Flask app but it did not change the situation

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

What am I doing wrong here ?

It is a bit late reply. Follow the following steps:

  1. Configure npm on your machine
  2. Navigate to the root directory of svgedit. Run $ npm build.
  3. Copy the contents of the dist folder and use it anywhere you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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