-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 🤖 refine loaders in meson build for ThorVG (#50)
* chore: 🤖 refine loaders in meson build for ThorVG * chore: 🤖 add changesets * chore: 🤖 size-limit for *.wasm files * chore: 🤖 simplify the size-limit config
- Loading branch information
Showing
8 changed files
with
514 additions
and
784 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 | ||
--- | ||
|
||
chore: 🤖 refine loaders in meson build for ThorVG |
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 |
---|---|---|
@@ -1,25 +1,18 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const packagesDir = path.join(__dirname, 'packages'); | ||
const packageDirs = fs.readdirSync(packagesDir); | ||
|
||
const packages = packageDirs | ||
.map((dir) => { | ||
const packageJsonPath = path.join(packagesDir, dir, 'package.json'); | ||
|
||
if (fs.existsSync(packageJsonPath)) { | ||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); | ||
|
||
return { | ||
name: packageJson.name, | ||
path: path.join(__dirname, packageJson.repository.directory, packageJson.module), | ||
import: '*', | ||
const dotLottieWebConfig = [ | ||
{ | ||
name: '@lottiefiles/dotlottie-web', | ||
path: 'packages/web/dist/index.js', | ||
import: '{ DotLottie }', | ||
}, | ||
{ | ||
name: '@lottiefiles/dotlottie-web WASM', | ||
path: 'packages/web/dist/*.wasm', | ||
modifyWebpackConfig: (config) => { | ||
config.experiments = { | ||
asyncWebAssembly: true, | ||
}; | ||
} | ||
|
||
return null; | ||
}) | ||
.filter(Boolean); | ||
}, | ||
}, | ||
]; | ||
|
||
module.exports = packages; | ||
module.exports = [...dotLottieWebConfig]; |
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
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.