title: Openlayers - ol is not defined
body: <p>I'm trying to run the map, with this code:</p>
  
  <pre><code>var map = new ol.Map({
      target: 'map',
      layers: [
        new ol.layer.Tile({
          source: new ol.source.OSM()
        })
      ],
      view: new ol.View({
        center: ol.proj.fromLonLat([{{$obj-&gt;config['longitude']}}, {{$obj-&gt;config['latitude']}}]),
        zoom: 17
      })
  });
  
  var layer = new ol.layer.Vector({
      source: new ol.source.Vector({
          /*
          features: [
              new ol.Feature({
                  geometry: new ol.geom.Point(ol.proj.fromLonLat( [ {{$obj-&gt;config['longitude']}}, {{$obj-&gt;config['latitude']}} ] ))
              })
          ]
          */
      })
  });
  </code></pre>
  
  <p>When I use code library from openlayers CDN everythig works fine. Problem occurs when I try to compile my own library. In this case map doesn't show. Console showing error: </p>
  
  <blockquote>
    <p>ReferenceError: ol is not defined</p>
  </blockquote>
  
  <p>My library is compiled in Laravel by npm:</p>
  
  <pre><code>import 'ol/ol.css';
  import {Map, View} from 'ol';
  import TileLayer from 'ol/layer/Tile';
  import OSM from 'ol/source/OSM';
  </code></pre>
  
  <p>It seems to me that the problem is due to the lack of importing a file but I don't know which one.</p>