forked from forks/ffprobe-wasm-npm
fix: add vite plugins for wasm
Signed-off-by: Alix von Schirp <github@avonschirp.bootmedia.de>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { resolve } from "path";
|
||||
import { defineConfig } from "vite";
|
||||
import topLevelAwait from "vite-plugin-top-level-await";
|
||||
import wasm from "vite-plugin-wasm";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -14,18 +16,23 @@ export default defineConfig({
|
||||
minify: false,
|
||||
sourcemap: true,
|
||||
},
|
||||
worker: {
|
||||
plugins: [
|
||||
{
|
||||
name: "append-source-url",
|
||||
generateBundle(options, bundle) {
|
||||
Object.entries(bundle).forEach(([file, output]) => {
|
||||
if (output.type === "chunk") {
|
||||
output.code += `\n//# sourceURL=${file}`;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
|
||||
wasm(),
|
||||
topLevelAwait()
|
||||
],
|
||||
// worker: {
|
||||
// plugins: [
|
||||
// // {
|
||||
// // name: "append-source-url",
|
||||
// // generateBundle(options, bundle) {
|
||||
// // Object.entries(bundle).forEach(([file, output]) => {
|
||||
// // if (output.type === "chunk") {
|
||||
// // output.code += `\n//# sourceURL=${file}`;
|
||||
// // }
|
||||
// // });
|
||||
// // },
|
||||
// // },
|
||||
// ],
|
||||
// },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user