forked from forks/ffprobe-wasm-npm
39 lines
941 B
TypeScript
39 lines
941 B
TypeScript
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({
|
|
build: {
|
|
outDir: resolve(__dirname, "dist"),
|
|
lib: {
|
|
entry: resolve(__dirname, "dist/browser-vite.mjs"),
|
|
formats: ["es"],
|
|
fileName: () => "browser.mjs",
|
|
},
|
|
emptyOutDir: false,
|
|
minify: false,
|
|
sourcemap: true,
|
|
},
|
|
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}`;
|
|
// // }
|
|
// // });
|
|
// // },
|
|
// // },
|
|
// ],
|
|
// },
|
|
});
|