bendc / animateplus

A+ animation module for the modern web
MIT License
5.96k stars 280 forks source link

Unexpected token export #47

Closed Omnipresent closed 6 years ago

Omnipresent commented 6 years ago

I am trying to use this in a simple static HTML website. I've imported the raw animateplus.js, however, in chrome it is showing me a JS error "Unexpected token export". What is the best way to resolve this?

bendc commented 6 years ago

You have to import Animate Plus as a module, e.g. :

<script type="module">
  import animate from "https://cdn.jsdelivr.net/npm/animateplus@2/animateplus.js";
  // animate({...});
</script>

Refer to the code of one of the examples if you need a starter template.