title: javascript import & model with Camunda web modeler
body: <p>I have a js with this declaration:</p>
  
  <pre><code>import Modeler from '.../Modeler';
  </code></pre>
  
  <p>and after this I define a var of type Modeler in the js:</p>
  
  <pre><code>var myModeler = new Modeler(...)
  </code></pre>
  
  <p>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.</p>
  
  <p>I try to declare the js where is the import, in this manner (with and without the type="model"):</p>
  
  <pre><code>&lt;script type="model" src="./MyCamunda.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>but again another error.</p>
  
  <p>Where I must put myModeler or change any declaration? </p>
  
  <p>EDIT:
  This is the html I use</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8" /&gt;
      &lt;title&gt;Camunda Modeler&lt;/title&gt;
  
      &lt;!-- required modeler styles --&gt;
      &lt;link rel="stylesheet" href="../node_modules/bpmn-js/dist/assets/diagram-js.css"&gt;
      &lt;link rel="stylesheet" href="../node_modules/bpmn-js/dist/assets/bpmn-font/css/bpmn.css"&gt;
      &lt;link rel="stylesheet" href="./MyCamunda.css"&gt;
  
      &lt;script src="https://unpkg.com/jquery@3.3.1/dist/jquery.js"&gt;&lt;/script&gt;
      &lt;script src="./MyCamunda.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          var diagramUrl = './diagramOriginal.bpmn';
          //load external diagram file via AJAX and open it
          $.get(diagramUrl, openDiagram, 'text');
          // wire save button
          $('#save-button').click(exportDiagram);
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="canvas"&gt;&lt;/div&gt;
      &lt;button id="save-button"&gt;print to console&lt;/button&gt;
    &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <p>And this is a snippet of js I use (MyCamunda.js):</p>
  
  <pre><code>import Modeler from '../node_modules/bpmn-js/lib/Modeler';
  var bpmnModeler = new Modeler({ container: '#canvas' });
  ...
  </code></pre>