bramp / js-sequence-diagrams

Draws simple SVG sequence diagrams from textual representation of the diagram
https://bramp.github.io/js-sequence-diagrams/
BSD 2-Clause "Simplified" License
7.8k stars 1.08k forks source link

How to use with Vue.js and Webpack? #200

Closed vitorvr closed 5 years ago

vitorvr commented 5 years ago

Hi I'm trying to use with Vue.js/Webpack but I'm in trouble to build that. To run dev server it's ok. I create a function to add the *.js on the document, and call this function when the component is mounted:

addExternalScrips () { let snap = document.createElement('script'); let underscore = document.createElement('script'); let sequence = document.createElement('script'); snap.setAttribute('src', '../../utils/snap.svg-min.js'); underscore.setAttribute('src', '../../utils/underscore-min.js'); sequence.setAttribute('src', '../../utils/sequence-diagram-min.js'); document.head.appendChild(snap); document.head.appendChild(underscore); document.head.appendChild(sequence); }

But when I try to build this didn't work.

I tried to import the files on Vue.js component like that: import '../../utils/webfont';

But got error that didn't find any modules.

Do you guys know how to do that? Thanks!