splide
splide copied to clipboard
Global object not available when built with ViteJS
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
- use splide via npm
- in the vite.config.js file add:
splide: '@splidejs/splide'to the rollupOptions.input - run vite build
- 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