-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide WASM file from our own CDN #423
Comments
You can achieve this by using the following code: import { setWasmUrl } from “@lottiefiles/dotlottie-react”;
React.useEffect(() => {
setWasmUrl(“/lib/dotlottie-player.wasm”);
}, []); Note: The |
@mabernethy If you’re using a js bundler like vite or webpack, you can use a file/url loader to resolve the file path of the WASM file into a self-hosted URL. Once you have the URL, you can use the Example (works well with vite): import { setWasmUrl } from "@lottiefiles/dotlottie-react";
setWasmUrl(
new URL(
"./node_modules/@lottiefiles/dotlottie-web/dist/dotlottie-player.wasm",
import.meta.url
).href
); I’ll update the docs as well to make this use case clear. Thanks for bringing this up! |
hello 👋 @theashraf! I have similar use case but for vue. Looks like Can you please confirm that the example approach above works for a vue app built w vite? Thank you! |
@jared-f 在vite中可以这样引入
|
@jared-f yes it should work the same way across different frameworks. Refer to Vite’s Asset Guide for more details. This approach works for Vite based Vue apps just as it does for React. |
Overview
Would it be possible to provide the dotlottie.wasm file from our own CDN, or even with in the React bundle itself (I'm using DotLottieReact). I noticed in the network tab when I'm loading one of the DotLottie retrieves the WASM file from the jsdeliver CDN. Our clients are security minded and have a white list of approved IP addresses that our software can access from behind their firewalls. It would be easier to avoid asking all of them to update their whitelist.
...
Type
Motivation
Labels
Type: Feature Request
label to this issue.The text was updated successfully, but these errors were encountered: