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

592 Views Asked by At

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 enter image description here

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 ?

1

There are 1 best solutions below

0
On

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.