Avoid library build warnings

This commit is contained in:
Jordan Eldredge 2025-07-05 16:32:55 -07:00
parent d4a841846c
commit 3e0417267a
2 changed files with 23 additions and 2 deletions

View file

@ -15,7 +15,7 @@ import {
} from "../actionTypes";
import { MEDIA_STATUS } from "../constants";
import { openMediaFileDialog } from "./";
import { openMediaFileDialog } from "./files";
import { GetState, Dispatch, Thunk, Action } from "../types";
import * as Selectors from "../selectors";

View file

@ -97,7 +97,28 @@ async function build() {
outputFile: bundleDesc.output.file,
minify: bundleDesc.minify,
});
const bundle = await rollup({ input: bundleDesc.input, plugins });
const bundle = await rollup({
input: bundleDesc.input,
plugins,
onwarn: (warning, warn) => {
// Suppress expected circular dependency warnings from external libraries
if (warning.code === "CIRCULAR_DEPENDENCY") {
const message = warning.message || "";
// Skip warnings for known external library circular dependencies
if (
message.includes("polyfill-node") ||
message.includes("readable-stream") ||
message.includes("jszip") ||
message.includes("music-metadata") ||
message.includes("node_modules")
) {
return; // Don't show these warnings
}
}
// Show all other warnings
warn(warning);
},
});
await bundle.write({
sourcemap: true,
...bundleDesc.output,