Update build step
This commit is contained in:
parent
61a9d8d612
commit
817beacc7a
12
dist/commands/build/index.js
vendored
12
dist/commands/build/index.js
vendored
@ -1,9 +1,8 @@
|
|||||||
import { Command } from "commander";
|
import { Command } from "commander";
|
||||||
import { log } from "../../utils/log";
|
import { log } from "../../utils/log";
|
||||||
import init from "../../functions/init";
|
|
||||||
import grabDirNames from "../../utils/grab-dir-names";
|
import grabDirNames from "../../utils/grab-dir-names";
|
||||||
import { rmSync } from "fs";
|
import { rmSync } from "fs";
|
||||||
import allPagesESBuildContextBundler from "../../functions/bundler/all-pages-esbuild-context-bundler";
|
import bunextInit from "../../functions/bunext-init";
|
||||||
const { HYDRATION_DST_DIR, BUNX_CWD_PAGES_REWRITE_DIR } = grabDirNames();
|
const { HYDRATION_DST_DIR, BUNX_CWD_PAGES_REWRITE_DIR } = grabDirNames();
|
||||||
export default function () {
|
export default function () {
|
||||||
return new Command("build")
|
return new Command("build")
|
||||||
@ -15,13 +14,8 @@ export default function () {
|
|||||||
}
|
}
|
||||||
catch (error) { }
|
catch (error) { }
|
||||||
global.SKIPPED_BROWSER_MODULES = new Set();
|
global.SKIPPED_BROWSER_MODULES = new Set();
|
||||||
// await rewritePagesModule();
|
await bunextInit({ build_only: true });
|
||||||
await init();
|
log.success("Modules Built Successfully!");
|
||||||
log.banner();
|
|
||||||
log.build("Building Project ...");
|
|
||||||
// await allPagesBunBundler();
|
|
||||||
// await allPagesBundler();
|
|
||||||
await allPagesESBuildContextBundler();
|
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
20
dist/commands/dev/index.js
vendored
20
dist/commands/dev/index.js
vendored
@ -35,13 +35,27 @@ async function dev() {
|
|||||||
NODE_ENV: "development",
|
NODE_ENV: "development",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let dev_process = Bun.spawn(spawn_options);
|
let dev_process;
|
||||||
|
try {
|
||||||
|
dev_process = Bun.spawn(spawn_options);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.error(`Failed to start dev process:`, error);
|
||||||
retries++;
|
retries++;
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
retries = 0;
|
retries = 0;
|
||||||
}, 10000);
|
}, 10000);
|
||||||
const exited = await dev_process.exited;
|
|
||||||
if (exited) {
|
|
||||||
return await dev();
|
return await dev();
|
||||||
}
|
}
|
||||||
|
const exited = await dev_process.exited;
|
||||||
|
if (exited) {
|
||||||
|
retries++;
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
|
return await dev();
|
||||||
|
}
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
}
|
}
|
||||||
|
|||||||
20
dist/commands/start/index.js
vendored
20
dist/commands/start/index.js
vendored
@ -34,13 +34,27 @@ async function start() {
|
|||||||
NODE_ENV: "production",
|
NODE_ENV: "production",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let dev_process = Bun.spawn(spawn_options);
|
let dev_process;
|
||||||
|
try {
|
||||||
|
dev_process = Bun.spawn(spawn_options);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.error(`Failed to start production process:`, error);
|
||||||
retries++;
|
retries++;
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
retries = 0;
|
retries = 0;
|
||||||
}, 10000);
|
}, 10000);
|
||||||
const exited = await dev_process.exited;
|
|
||||||
if (exited) {
|
|
||||||
return await start();
|
return await start();
|
||||||
}
|
}
|
||||||
|
const exited = await dev_process.exited;
|
||||||
|
if (exited) {
|
||||||
|
retries++;
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
|
return await start();
|
||||||
|
}
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ type Params = {
|
|||||||
post_build_fn?: (params: {
|
post_build_fn?: (params: {
|
||||||
artifacts: BundlerCTXMap[];
|
artifacts: BundlerCTXMap[];
|
||||||
}) => Promise<void> | void;
|
}) => Promise<void> | void;
|
||||||
|
build_only?: boolean;
|
||||||
};
|
};
|
||||||
export default function allPagesESBuildContextBundler(params?: Params): Promise<void>;
|
export default function allPagesESBuildContextBundler(params?: Params): Promise<void>;
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
@ -50,6 +50,7 @@ export default async function allPagesESBuildContextBundler(params) {
|
|||||||
esbuildCTXArtifactTracker({
|
esbuildCTXArtifactTracker({
|
||||||
entryToPage,
|
entryToPage,
|
||||||
post_build_fn: params?.post_build_fn,
|
post_build_fn: params?.post_build_fn,
|
||||||
|
build_only: params?.build_only,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
jsx: "automatic",
|
jsx: "automatic",
|
||||||
|
|||||||
@ -7,6 +7,7 @@ type Params = {
|
|||||||
post_build_fn?: (params: {
|
post_build_fn?: (params: {
|
||||||
artifacts: any[];
|
artifacts: any[];
|
||||||
}) => Promise<void> | void;
|
}) => Promise<void> | void;
|
||||||
|
build_only?: boolean;
|
||||||
};
|
};
|
||||||
export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn, }: Params): Plugin;
|
export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn, build_only, }: Params): Plugin;
|
||||||
export {};
|
export {};
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import cleanupLogsDirs from "../../cleanup-logs-dir";
|
|||||||
const { BUNX_BUNDLER_ERROR_EXIT_FILE, BUNX_ERROR_LOGS_DIR } = grabDirNames();
|
const { BUNX_BUNDLER_ERROR_EXIT_FILE, BUNX_ERROR_LOGS_DIR } = grabDirNames();
|
||||||
let build_start = 0;
|
let build_start = 0;
|
||||||
const MAX_BUILD_STARTS = 2;
|
const MAX_BUILD_STARTS = 2;
|
||||||
export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn, }) {
|
export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn, build_only, }) {
|
||||||
const artifactTracker = {
|
const artifactTracker = {
|
||||||
name: "artifact-tracker",
|
name: "artifact-tracker",
|
||||||
setup(build) {
|
setup(build) {
|
||||||
@ -25,7 +25,7 @@ export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn,
|
|||||||
await buildOnstartErrorHandler();
|
await buildOnstartErrorHandler();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
build.onEnd((result) => {
|
build.onEnd(async (result) => {
|
||||||
if (result.errors.length > 0) {
|
if (result.errors.length > 0) {
|
||||||
global.RECOMPILING = false;
|
global.RECOMPILING = false;
|
||||||
global.IS_SERVER_COMPONENT = false;
|
global.IS_SERVER_COMPONENT = false;
|
||||||
@ -65,12 +65,20 @@ export default function esbuildCTXArtifactTracker({ entryToPage, post_build_fn,
|
|||||||
global.MAIN_CTX_BUILD_STARTS = 0;
|
global.MAIN_CTX_BUILD_STARTS = 0;
|
||||||
global.BUNDLER_CTX_DISPOSED = false;
|
global.BUNDLER_CTX_DISPOSED = false;
|
||||||
const does_error_file_exist = existsSync(BUNX_BUNDLER_ERROR_EXIT_FILE);
|
const does_error_file_exist = existsSync(BUNX_BUNDLER_ERROR_EXIT_FILE);
|
||||||
if (does_error_file_exist) {
|
if (build_only) {
|
||||||
|
try {
|
||||||
|
await pagesSSRBundler();
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
log.error(`SSR Bundler Error: ${error}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (does_error_file_exist) {
|
||||||
mkdirSync(BUNX_ERROR_LOGS_DIR, { recursive: true });
|
mkdirSync(BUNX_ERROR_LOGS_DIR, { recursive: true });
|
||||||
cpSync(BUNX_BUNDLER_ERROR_EXIT_FILE, path.join(BUNX_ERROR_LOGS_DIR, `${Date.now()}.log`));
|
cpSync(BUNX_BUNDLER_ERROR_EXIT_FILE, path.join(BUNX_ERROR_LOGS_DIR, `${Date.now()}.log`));
|
||||||
rmSync(BUNX_BUNDLER_ERROR_EXIT_FILE, { force: true });
|
rmSync(BUNX_BUNDLER_ERROR_EXIT_FILE, { force: true });
|
||||||
cleanupLogsDirs();
|
cleanupLogsDirs();
|
||||||
fullRebuild();
|
await fullRebuild();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
|
|||||||
6
dist/functions/bunext-init.d.ts
vendored
6
dist/functions/bunext-init.d.ts
vendored
@ -47,4 +47,8 @@ declare global {
|
|||||||
var CONSTANTS: ReturnType<typeof grabConstants>;
|
var CONSTANTS: ReturnType<typeof grabConstants>;
|
||||||
var MAIN_CTX_BUILD_STARTS: number;
|
var MAIN_CTX_BUILD_STARTS: number;
|
||||||
}
|
}
|
||||||
export default function bunextInit(): Promise<void>;
|
type Params = {
|
||||||
|
build_only?: boolean;
|
||||||
|
};
|
||||||
|
export default function bunextInit(params?: Params): Promise<void>;
|
||||||
|
export {};
|
||||||
|
|||||||
8
dist/functions/bunext-init.js
vendored
8
dist/functions/bunext-init.js
vendored
@ -10,7 +10,7 @@ import grabConstants from "../utils/grab-constants";
|
|||||||
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
||||||
const dirNames = grabDirNames();
|
const dirNames = grabDirNames();
|
||||||
const { PAGES_DIR } = dirNames;
|
const { PAGES_DIR } = dirNames;
|
||||||
export default async function bunextInit() {
|
export default async function bunextInit(params) {
|
||||||
global.HMR_CONTROLLERS = [];
|
global.HMR_CONTROLLERS = [];
|
||||||
global.BUNDLER_CTX_MAP = {};
|
global.BUNDLER_CTX_MAP = {};
|
||||||
global.SSR_BUNDLER_CTX_MAP = {};
|
global.SSR_BUNDLER_CTX_MAP = {};
|
||||||
@ -33,7 +33,11 @@ export default async function bunextInit() {
|
|||||||
});
|
});
|
||||||
global.ROUTER = router;
|
global.ROUTER = router;
|
||||||
const is_dev = isDevelopment();
|
const is_dev = isDevelopment();
|
||||||
if (is_dev) {
|
if (params?.build_only) {
|
||||||
|
log.build(`Building Modules ...`);
|
||||||
|
await allPagesESBuildContextBundler();
|
||||||
|
}
|
||||||
|
else if (is_dev) {
|
||||||
log.build(`Building Modules ...`);
|
log.build(`Building Modules ...`);
|
||||||
await allPagesESBuildContextBundler({
|
await allPagesESBuildContextBundler({
|
||||||
post_build_fn: () => {
|
post_build_fn: () => {
|
||||||
|
|||||||
2
dist/functions/server/full-rebuild.js
vendored
2
dist/functions/server/full-rebuild.js
vendored
@ -18,7 +18,7 @@ export default async function fullRebuild(params) {
|
|||||||
}
|
}
|
||||||
catch (error) { }
|
catch (error) { }
|
||||||
// await pagesSSRBundler();
|
// await pagesSSRBundler();
|
||||||
allPagesESBuildContextBundler({
|
await allPagesESBuildContextBundler({
|
||||||
post_build_fn: () => {
|
post_build_fn: () => {
|
||||||
serverPostBuildFn();
|
serverPostBuildFn();
|
||||||
},
|
},
|
||||||
|
|||||||
1
dist/functions/server/watcher-esbuild-ctx.js
vendored
1
dist/functions/server/watcher-esbuild-ctx.js
vendored
@ -22,6 +22,7 @@ export default async function watcherEsbuildCTX() {
|
|||||||
}
|
}
|
||||||
if (global.BUNDLER_CTX_DISPOSED) {
|
if (global.BUNDLER_CTX_DISPOSED) {
|
||||||
await fullRebuild({ msg: `Restarting Bundler ...` });
|
await fullRebuild({ msg: `Restarting Bundler ...` });
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (global.SSR_BUNDLER_CTX_DISPOSED) {
|
if (global.SSR_BUNDLER_CTX_DISPOSED) {
|
||||||
pagesSSRBundler();
|
pagesSSRBundler();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/bunext",
|
"name": "@moduletrace/bunext",
|
||||||
"version": "1.0.94",
|
"version": "1.0.95",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
import { Command } from "commander";
|
import { Command } from "commander";
|
||||||
import { log } from "../../utils/log";
|
import { log } from "../../utils/log";
|
||||||
import init from "../../functions/init";
|
|
||||||
import grabDirNames from "../../utils/grab-dir-names";
|
import grabDirNames from "../../utils/grab-dir-names";
|
||||||
import { rmSync } from "fs";
|
import { rmSync } from "fs";
|
||||||
import allPagesESBuildContextBundler from "../../functions/bundler/all-pages-esbuild-context-bundler";
|
import bunextInit from "../../functions/bunext-init";
|
||||||
|
|
||||||
const { HYDRATION_DST_DIR, BUNX_CWD_PAGES_REWRITE_DIR } = grabDirNames();
|
const { HYDRATION_DST_DIR, BUNX_CWD_PAGES_REWRITE_DIR } = grabDirNames();
|
||||||
|
|
||||||
@ -18,16 +17,9 @@ export default function () {
|
|||||||
|
|
||||||
global.SKIPPED_BROWSER_MODULES = new Set<string>();
|
global.SKIPPED_BROWSER_MODULES = new Set<string>();
|
||||||
|
|
||||||
// await rewritePagesModule();
|
await bunextInit({ build_only: true });
|
||||||
await init();
|
|
||||||
|
|
||||||
log.banner();
|
log.success("Modules Built Successfully!");
|
||||||
log.build("Building Project ...");
|
|
||||||
|
|
||||||
// await allPagesBunBundler();
|
|
||||||
|
|
||||||
// await allPagesBundler();
|
|
||||||
await allPagesESBuildContextBundler();
|
|
||||||
|
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -44,16 +44,29 @@ async function dev() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let dev_process = Bun.spawn(spawn_options);
|
let dev_process;
|
||||||
|
try {
|
||||||
|
dev_process = Bun.spawn(spawn_options);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to start dev process:`, error);
|
||||||
retries++;
|
retries++;
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
|
return await dev();
|
||||||
|
}
|
||||||
|
|
||||||
|
const exited = await dev_process.exited;
|
||||||
|
|
||||||
|
if (exited) {
|
||||||
|
retries++;
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
|
return await dev();
|
||||||
|
}
|
||||||
|
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
retries = 0;
|
retries = 0;
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
const exited = await dev_process.exited;
|
|
||||||
if (exited) {
|
|
||||||
return await dev();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,17 +45,29 @@ async function start() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let dev_process = Bun.spawn(spawn_options);
|
let dev_process;
|
||||||
|
try {
|
||||||
|
dev_process = Bun.spawn(spawn_options);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to start production process:`, error);
|
||||||
retries++;
|
retries++;
|
||||||
|
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
retries = 0;
|
retries = 0;
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
return await start();
|
||||||
|
}
|
||||||
|
|
||||||
const exited = await dev_process.exited;
|
const exited = await dev_process.exited;
|
||||||
|
|
||||||
if (exited) {
|
if (exited) {
|
||||||
|
retries++;
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
return await start();
|
return await start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timeout = setTimeout(() => {
|
||||||
|
retries = 0;
|
||||||
|
}, 10000);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ type Params = {
|
|||||||
post_build_fn?: (params: {
|
post_build_fn?: (params: {
|
||||||
artifacts: BundlerCTXMap[];
|
artifacts: BundlerCTXMap[];
|
||||||
}) => Promise<void> | void;
|
}) => Promise<void> | void;
|
||||||
|
build_only?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function allPagesESBuildContextBundler(params?: Params) {
|
export default async function allPagesESBuildContextBundler(params?: Params) {
|
||||||
@ -82,6 +83,7 @@ export default async function allPagesESBuildContextBundler(params?: Params) {
|
|||||||
esbuildCTXArtifactTracker({
|
esbuildCTXArtifactTracker({
|
||||||
entryToPage,
|
entryToPage,
|
||||||
post_build_fn: params?.post_build_fn,
|
post_build_fn: params?.post_build_fn,
|
||||||
|
build_only: params?.build_only,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
jsx: "automatic",
|
jsx: "automatic",
|
||||||
|
|||||||
@ -24,11 +24,13 @@ type Params = {
|
|||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
post_build_fn?: (params: { artifacts: any[] }) => Promise<void> | void;
|
post_build_fn?: (params: { artifacts: any[] }) => Promise<void> | void;
|
||||||
|
build_only?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function esbuildCTXArtifactTracker({
|
export default function esbuildCTXArtifactTracker({
|
||||||
entryToPage,
|
entryToPage,
|
||||||
post_build_fn,
|
post_build_fn,
|
||||||
|
build_only,
|
||||||
}: Params) {
|
}: Params) {
|
||||||
const artifactTracker: Plugin = {
|
const artifactTracker: Plugin = {
|
||||||
name: "artifact-tracker",
|
name: "artifact-tracker",
|
||||||
@ -49,7 +51,7 @@ export default function esbuildCTXArtifactTracker({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
build.onEnd((result) => {
|
build.onEnd(async (result) => {
|
||||||
if (result.errors.length > 0) {
|
if (result.errors.length > 0) {
|
||||||
global.RECOMPILING = false;
|
global.RECOMPILING = false;
|
||||||
global.IS_SERVER_COMPONENT = false;
|
global.IS_SERVER_COMPONENT = false;
|
||||||
@ -112,7 +114,13 @@ export default function esbuildCTXArtifactTracker({
|
|||||||
BUNX_BUNDLER_ERROR_EXIT_FILE,
|
BUNX_BUNDLER_ERROR_EXIT_FILE,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (does_error_file_exist) {
|
if (build_only) {
|
||||||
|
try {
|
||||||
|
await pagesSSRBundler();
|
||||||
|
} catch (error) {
|
||||||
|
log.error(`SSR Bundler Error: ${error}`);
|
||||||
|
}
|
||||||
|
} else if (does_error_file_exist) {
|
||||||
mkdirSync(BUNX_ERROR_LOGS_DIR, { recursive: true });
|
mkdirSync(BUNX_ERROR_LOGS_DIR, { recursive: true });
|
||||||
cpSync(
|
cpSync(
|
||||||
BUNX_BUNDLER_ERROR_EXIT_FILE,
|
BUNX_BUNDLER_ERROR_EXIT_FILE,
|
||||||
@ -120,7 +128,7 @@ export default function esbuildCTXArtifactTracker({
|
|||||||
);
|
);
|
||||||
rmSync(BUNX_BUNDLER_ERROR_EXIT_FILE, { force: true });
|
rmSync(BUNX_BUNDLER_ERROR_EXIT_FILE, { force: true });
|
||||||
cleanupLogsDirs();
|
cleanupLogsDirs();
|
||||||
fullRebuild();
|
await fullRebuild();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
pagesSSRBundler();
|
pagesSSRBundler();
|
||||||
|
|||||||
@ -58,7 +58,11 @@ declare global {
|
|||||||
const dirNames = grabDirNames();
|
const dirNames = grabDirNames();
|
||||||
const { PAGES_DIR } = dirNames;
|
const { PAGES_DIR } = dirNames;
|
||||||
|
|
||||||
export default async function bunextInit() {
|
type Params = {
|
||||||
|
build_only?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function bunextInit(params?: Params) {
|
||||||
global.HMR_CONTROLLERS = [];
|
global.HMR_CONTROLLERS = [];
|
||||||
global.BUNDLER_CTX_MAP = {};
|
global.BUNDLER_CTX_MAP = {};
|
||||||
global.SSR_BUNDLER_CTX_MAP = {};
|
global.SSR_BUNDLER_CTX_MAP = {};
|
||||||
@ -88,7 +92,10 @@ export default async function bunextInit() {
|
|||||||
|
|
||||||
const is_dev = isDevelopment();
|
const is_dev = isDevelopment();
|
||||||
|
|
||||||
if (is_dev) {
|
if (params?.build_only) {
|
||||||
|
log.build(`Building Modules ...`);
|
||||||
|
await allPagesESBuildContextBundler();
|
||||||
|
} else if (is_dev) {
|
||||||
log.build(`Building Modules ...`);
|
log.build(`Building Modules ...`);
|
||||||
await allPagesESBuildContextBundler({
|
await allPagesESBuildContextBundler({
|
||||||
post_build_fn: () => {
|
post_build_fn: () => {
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export default async function fullRebuild(params?: { msg?: string }) {
|
|||||||
|
|
||||||
// await pagesSSRBundler();
|
// await pagesSSRBundler();
|
||||||
|
|
||||||
allPagesESBuildContextBundler({
|
await allPagesESBuildContextBundler({
|
||||||
post_build_fn: () => {
|
post_build_fn: () => {
|
||||||
serverPostBuildFn();
|
serverPostBuildFn();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -29,6 +29,7 @@ export default async function watcherEsbuildCTX() {
|
|||||||
|
|
||||||
if (global.BUNDLER_CTX_DISPOSED) {
|
if (global.BUNDLER_CTX_DISPOSED) {
|
||||||
await fullRebuild({ msg: `Restarting Bundler ...` });
|
await fullRebuild({ msg: `Restarting Bundler ...` });
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global.SSR_BUNDLER_CTX_DISPOSED) {
|
if (global.SSR_BUNDLER_CTX_DISPOSED) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user