flackr / scroll-timeline

A polyfill of ScrollTimeline.
Apache License 2.0
887 stars 82 forks source link

Use vite to build #224

Closed flackr closed 5 months ago

flackr commented 5 months ago

This is an experiment to see how vite works for #219. This PR right now only contains minimal changes to switch to vite. This fixes #188 as the build forces "use strict".

flackr commented 5 months ago

This is looking pretty promising so far.

Going back to the list of goals, we should be able to:

  1. Create multiple build targets. We can either use environment variables, or different vite config files to control this.
  2. Reserved names can be specified by setting build.terserOptions to include a reserved list of names to not mangle.
  3. Typescript support is as easy as invoking tsc before vite build.
  4. I don't think auto-publishing to npm would be part of the build system. I think this would be better suited as a github action.
  5. The github build action for vite seems to be 1s to microbundle's 4s. Vite also has a magically auto-updating dev server which reloads browser windows for extra speed.
  6. As with 4, I think this is best met with github actions?
flackr commented 5 months ago

@bramus @johannesodland I think we should go ahead with this, and then I can make followon PR's to meet the specific goals as outlined in https://github.com/flackr/scroll-timeline/pull/224#issuecomment-1925439103