I have a js with this declaration:
import Modeler from '.../Modeler';
and after this I define a var of type Modeler in the js:
var myModeler = new Modeler(...)
When I try to use this variable (myModeler) in an html (in script-tag), I find an exception "myModeler not found". If I move the declaration above (var myModeler...) outside the js, so in my html, I find an exception about the type "Modeler doesn't exist.
I try to declare the js where is the import, in this manner (with and without the type="model"):
<script type="model" src="./MyCamunda.js"></script>
but again another error.
Where I must put myModeler or change any declaration?
EDIT: This is the html I use
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Camunda Modeler</title>
<!-- required modeler styles -->
<link rel="stylesheet" href="../node_modules/bpmn-js/dist/assets/diagram-js.css">
<link rel="stylesheet" href="../node_modules/bpmn-js/dist/assets/bpmn-font/css/bpmn.css">
<link rel="stylesheet" href="./MyCamunda.css">
<script src="https://unpkg.com/jquery@3.3.1/dist/jquery.js"></script>
<script src="./MyCamunda.js"></script>
<script>
var diagramUrl = './diagramOriginal.bpmn';
//load external diagram file via AJAX and open it
$.get(diagramUrl, openDiagram, 'text');
// wire save button
$('#save-button').click(exportDiagram);
</script>
</head>
<body>
<div id="canvas"></div>
<button id="save-button">print to console</button>
</body>
</html>
And this is a snippet of js I use (MyCamunda.js):
import Modeler from '../node_modules/bpmn-js/lib/Modeler';
var bpmnModeler = new Modeler({ container: '#canvas' });
...