splide icon indicating copy to clipboard operation
splide copied to clipboard

Global object not available when built with ViteJS

Open samuelbirch opened this issue 3 years ago • 0 comments

Checks

  • [X] Not a duplicate.
  • [X] Not a question, feature request, or anything other than a bug report directly related to Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions

Version

4.1.4

Description

I'm using Splide via npm and when Vitejs is running as the devServer it all works fine, but once its been built with Splide as an external dependency and loaded on to the page on demand using a manual script tag with this file. The global Splide object is unavailable.

Reproduction Link

No response

Steps to Reproduce

  1. use splide via npm
  2. in the vite.config.js file add: splide: '@splidejs/splide' to the rollupOptions.input
  3. run vite build
  4. add a script tag referencing the built splide file

Expected Behaviour

expect to have the Splide object available globally as when running in the devServer

samuelbirch avatar Jan 04 '23 10:01 samuelbirch