If you want to try out OpenLayers without downloading anything (not recommended for production), include the following in the head of your html page:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ol.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/ol.css">
The full build of the library does not include all dependencies: the
ol-mapbox-style packages are omitted. If you use these, you'll need to add additional script tags.