Is there any ways to create custom element with pure html/js


#1

Hi Guys,
I’m trying to import bpmnjs into my html site.
I’m using “https://unpkg.com/bpmn-js@1.3.2/dist/bpmn-viewer.development.js” as started and as the title: Is there any ways to create custom element with pure html/js.

My project did not using npm.

Thanks guys,


#2

What do you mean by pure HTML/JS? What else would you need? Can you give more context about what you’re trying to achieve and what you’ve already done to achieve this?


#3

There is no obligation to use a module system of any kind. Simply use the modeler starter and hack the stuff seen in the custom elements example inside the HTML file.

Bundling / modularization will benefit you in the longer run once your application growth, though.


#4

Thanks Guys,

In my context, We just use html code + js code.

Not NodeJS, not NPM. Just “https://unpkg.com/bpmn-js@1.3.2/dist/bpmn-viewer.development.js

So, https://github.com/bpmn-io/bpmn-js-examples/tree/master/custom-elements is not suitable for me in this case.


#5

As mentioned in my previous comment it should be straight forward for you to inline the file contents exposed in the custom elements example into a single file (i.e. the starter template). Using our libraries does not force you to use a specific module system of some sort.

I suggest you to learn a little bit more about JavaScript and ways to modularize / split or not to split up your code. This will help you better understand how to embed our libraries, too.


#6