Bundle browser script, add package exports, add sourcemaps

This commit is contained in:
Tomás Fox
2022-03-15 15:27:19 -03:00
parent ab5cfd8582
commit e447a242c7
13 changed files with 1028 additions and 80 deletions

View File

@@ -9,14 +9,17 @@ rm -rf ffprobe-wasm-app/dist
# Build wasm
cd ffprobe-wasm-app
# sed -i -e 's/ffprobe-wasm\.js/ffprobe-wasm.mjs/g;s/-o dist\/ffprobe-wasm\.mjs \\/-o dist\/ffprobe-wasm.mjs -s EXPORT_NAME=ffprobe \\/' Makefile
docker-compose run ffprobe-wasm make
cd ..
cp -R ffprobe-wasm-app/dist dist
node scripts/replace.js
cp src/*.d.* dist
# Build browser/node workers
npm run build
# Remove unnecessary files
rm dist/browser-vite.* dist/ffprobe-wasm.d.mts dist/ffprobe-wasm.mjs dist/worker-browser.*
# Copy files for npm publish
cp package.json LICENSE README.md dist