-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): 🐛 Parcel build issue for DotLottieWorker (#335)
Parcel build was failing in version 0.30.3 due to the usage of a string literal to create a Worker, which is not supported. This patch modifies the worker instantiation to use a Blob instead, ensuring compatibility with Parcel's requirements.
- Loading branch information
Showing
7 changed files
with
1,683 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lottiefiles/dotlottie-web': patch | ||
--- | ||
|
||
fix(web): 🐛 Resolved Parcel build failure by creating Worker using a Blob instead of a string literal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,3 +58,5 @@ tsdoc-metadata.json | |
|
||
# Typescript | ||
*.tsbuildinfo | ||
|
||
.parcel-cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Parcel</title> | ||
</head> | ||
<body> | ||
<canvas id="dotLottie-canvas"></canvas> | ||
<script src="./src/main.js" type="module"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "with-parcel-example", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"build": "parcel build index.html --no-cache", | ||
"dev": "parcel index.html --no-cache --open" | ||
}, | ||
"dependencies": { | ||
"@lottiefiles/dotlottie-web": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"parcel": "^2.12.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { DotLottieWorker } from '@lottiefiles/dotlottie-web'; | ||
|
||
// eslint-disable-next-line no-new | ||
new DotLottieWorker({ | ||
// eslint-disable-next-line no-undef | ||
canvas: document.getElementById('dotLottie-canvas'), | ||
src: 'https://lottie.host/e641272e-039b-4612-96de-138acfbede6e/bc0sW78EeR.lottie', | ||
autoplay: true, | ||
loop: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.