Files
wehub-resource-sync 311a3666c4
Build documentation / build (push) Failing after 0s
Unit tests / build (18) (push) Has been cancelled
Unit tests / build (20) (push) Has been cancelled
Unit tests / build (22) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:44:39 +08:00

39 lines
1.2 KiB
JavaScript

import path from "node:path";
import { fileURLToPath } from "node:url";
export const DIST_FOLDER = "dist";
export const NODE_IGNORE_MODULES = ["onnxruntime-web"];
export const NODE_EXTERNAL_MODULES = [
"onnxruntime-common",
"onnxruntime-node",
"sharp",
// node:* modules are handled by externalNodeBuiltinsPlugin
];
export const WEB_IGNORE_MODULES = ["onnxruntime-node", "sharp", "fs", "path", "url", "stream", "stream/promises"];
export const WEB_EXTERNAL_MODULES = ["onnxruntime-common", "onnxruntime-web"];
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export const ROOT_DIR = path.join(__dirname, "../..");
export const OUT_DIR = path.join(ROOT_DIR, DIST_FOLDER);
export const getEsbuildDevConfig = (rootDir) => ({
bundle: true,
treeShaking: true,
logLevel: "info",
entryPoints: [path.join(rootDir, "src/transformers.js")],
platform: "neutral",
format: "esm",
sourcemap: true,
logOverride: {
// Suppress import.meta warning for CJS builds - it's handled gracefully in the code
"empty-import-meta": "silent",
},
});
export const getEsbuildProdConfig = (rootDir) => ({
...getEsbuildDevConfig(rootDir),
logLevel: "warning",
sourcemap: false,
});