Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -3,15 +3,15 @@ import { builtinModules } from "node:module";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { build } from "esbuild";
|
||||
import { precompressWebAssets, pruneUnreferencedDuplicateCss } from "./precompress-web-assets.mjs";
|
||||
|
||||
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const entryPoint = path.join(rootDir, "server/server.ts");
|
||||
const outputFile = path.join(rootDir, "build/server-runtime/server.js");
|
||||
const nodeBuiltins = new Set([...builtinModules, ...builtinModules.map((moduleName) => `node:${moduleName}`)]);
|
||||
const buildSourcemapsEnabled =
|
||||
process.env.HIVEGRID_BUILD_SOURCEMAPS === "1" ||
|
||||
process.env.SOURCEMAP === "true" ||
|
||||
process.env.BUILD_SOURCEMAPS === "true";
|
||||
const buildSourcemapsEnabled = process.env.HIVEGRID_BUILD_SOURCEMAPS === "1" || process.env.SOURCEMAP === "true" || process.env.BUILD_SOURCEMAPS === "true";
|
||||
const browserCspBuildEnvKeys = ["VITE_SENTRY_DSN_WEB", "VITE_OTEL_EXPORTER_OTLP_ENDPOINT", "VITE_HOCUSPOCUS_URL"];
|
||||
const browserCspBuildEnvDefines = Object.fromEntries(browserCspBuildEnvKeys.map((name) => [`process.env.${name}`, JSON.stringify(process.env[name] ?? "")]));
|
||||
|
||||
const externalizeRuntimeDependencies = {
|
||||
name: "externalize-runtime-dependencies",
|
||||
@@ -38,8 +38,9 @@ await build({
|
||||
bundle: true,
|
||||
platform: "node",
|
||||
format: "esm",
|
||||
target: "node20",
|
||||
target: "node24",
|
||||
sourcemap: buildSourcemapsEnabled,
|
||||
define: browserCspBuildEnvDefines,
|
||||
banner: {
|
||||
js: 'import { createRequire as __hivegridCreateRequire } from "node:module"; const require = __hivegridCreateRequire(import.meta.url);',
|
||||
},
|
||||
@@ -47,6 +48,12 @@ await build({
|
||||
logLevel: "warning",
|
||||
});
|
||||
|
||||
for (const buildDirectory of ["build", "build-portal"]) {
|
||||
const clientBuildDirectory = path.join(rootDir, "apps", "web", buildDirectory, "client");
|
||||
await pruneUnreferencedDuplicateCss(path.join(clientBuildDirectory, "assets"));
|
||||
await precompressWebAssets(clientBuildDirectory);
|
||||
}
|
||||
|
||||
function isBarePackageSpecifier(specifier) {
|
||||
return !specifier.startsWith(".") && !specifier.startsWith("/") && !specifier.startsWith("#");
|
||||
}
|
||||
@@ -65,6 +72,8 @@ function isExternalRuntimePackage(specifier) {
|
||||
specifier.startsWith("@prisma/client/") ||
|
||||
specifier === "@prisma/adapter-pg" ||
|
||||
specifier.startsWith("@prisma/adapter-pg/") ||
|
||||
specifier === "pg" ||
|
||||
specifier.startsWith("pg/") ||
|
||||
specifier === "jsonwebtoken" ||
|
||||
specifier.startsWith("jsonwebtoken/") ||
|
||||
specifier === "pino" ||
|
||||
|
||||
Reference in new issue
Block a user