Update init function
This commit is contained in:
parent
7dbd1f7e12
commit
48c25d2fb4
4
dist/commands/dev/index.js
vendored
4
dist/commands/dev/index.js
vendored
@ -20,10 +20,6 @@ export default function () {
|
|||||||
}
|
}
|
||||||
catch (error) { }
|
catch (error) { }
|
||||||
await bunextInit();
|
await bunextInit();
|
||||||
// await allPagesBunBundler();
|
|
||||||
await allPagesESBuildContextBundler({
|
|
||||||
post_build_fn: serverPostBuildFn,
|
|
||||||
});
|
|
||||||
await startServer();
|
await startServer();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
4
dist/commands/start/index.js
vendored
4
dist/commands/start/index.js
vendored
@ -2,8 +2,6 @@ import { Command } from "commander";
|
|||||||
import startServer from "../../functions/server/start-server";
|
import startServer from "../../functions/server/start-server";
|
||||||
import { log } from "../../utils/log";
|
import { log } from "../../utils/log";
|
||||||
import bunextInit from "../../functions/bunext-init";
|
import bunextInit from "../../functions/bunext-init";
|
||||||
import allPagesBunBundler from "../../functions/bundler/all-pages-bun-bundler";
|
|
||||||
import allPagesESBuildContextBundler from "../../functions/bundler/all-pages-esbuild-context-bundler";
|
|
||||||
export default function () {
|
export default function () {
|
||||||
return new Command("start")
|
return new Command("start")
|
||||||
.description("Start production server")
|
.description("Start production server")
|
||||||
@ -11,8 +9,6 @@ export default function () {
|
|||||||
process.env.NODE_ENV = "production";
|
process.env.NODE_ENV = "production";
|
||||||
log.info("Starting production server ...");
|
log.info("Starting production server ...");
|
||||||
await bunextInit();
|
await bunextInit();
|
||||||
// await allPagesBunBundler();
|
|
||||||
await allPagesESBuildContextBundler();
|
|
||||||
await startServer();
|
await startServer();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,7 @@ export default async function allPagesESBuildContextBundler(params) {
|
|||||||
],
|
],
|
||||||
jsx: "automatic",
|
jsx: "automatic",
|
||||||
splitting: true,
|
splitting: true,
|
||||||
|
treeShaking: true,
|
||||||
logLevel: "silent",
|
logLevel: "silent",
|
||||||
// logLevel: "silent",
|
// logLevel: "silent",
|
||||||
// logLevel: dev ? "error" : "silent",
|
// logLevel: dev ? "error" : "silent",
|
||||||
|
|||||||
6
dist/functions/bunext-init.js
vendored
6
dist/functions/bunext-init.js
vendored
@ -5,6 +5,8 @@ import isDevelopment from "../utils/is-development";
|
|||||||
import { log } from "../utils/log";
|
import { log } from "../utils/log";
|
||||||
import cron from "./server/cron";
|
import cron from "./server/cron";
|
||||||
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
||||||
|
import allPagesESBuildContextBundler from "./bundler/all-pages-esbuild-context-bundler";
|
||||||
|
import serverPostBuildFn from "./server/server-post-build-fn";
|
||||||
const dirNames = grabDirNames();
|
const dirNames = grabDirNames();
|
||||||
const { PAGES_DIR } = dirNames;
|
const { PAGES_DIR } = dirNames;
|
||||||
export default async function bunextInit() {
|
export default async function bunextInit() {
|
||||||
@ -23,9 +25,13 @@ export default async function bunextInit() {
|
|||||||
global.ROUTER = router;
|
global.ROUTER = router;
|
||||||
const is_dev = isDevelopment();
|
const is_dev = isDevelopment();
|
||||||
if (is_dev) {
|
if (is_dev) {
|
||||||
|
await allPagesESBuildContextBundler({
|
||||||
|
post_build_fn: serverPostBuildFn,
|
||||||
|
});
|
||||||
watcherEsbuildCTX();
|
watcherEsbuildCTX();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
await allPagesESBuildContextBundler();
|
||||||
cron();
|
cron();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "@moduletrace/bunext",
|
"name": "@moduletrace/bunext",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.0.44",
|
"version": "1.0.45",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@ -25,12 +25,6 @@ export default function () {
|
|||||||
|
|
||||||
await bunextInit();
|
await bunextInit();
|
||||||
|
|
||||||
// await allPagesBunBundler();
|
|
||||||
|
|
||||||
await allPagesESBuildContextBundler({
|
|
||||||
post_build_fn: serverPostBuildFn,
|
|
||||||
});
|
|
||||||
|
|
||||||
await startServer();
|
await startServer();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,6 @@ import { Command } from "commander";
|
|||||||
import startServer from "../../functions/server/start-server";
|
import startServer from "../../functions/server/start-server";
|
||||||
import { log } from "../../utils/log";
|
import { log } from "../../utils/log";
|
||||||
import bunextInit from "../../functions/bunext-init";
|
import bunextInit from "../../functions/bunext-init";
|
||||||
import allPagesBunBundler from "../../functions/bundler/all-pages-bun-bundler";
|
|
||||||
import allPagesESBuildContextBundler from "../../functions/bundler/all-pages-esbuild-context-bundler";
|
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
return new Command("start")
|
return new Command("start")
|
||||||
@ -14,9 +12,6 @@ export default function () {
|
|||||||
|
|
||||||
await bunextInit();
|
await bunextInit();
|
||||||
|
|
||||||
// await allPagesBunBundler();
|
|
||||||
await allPagesESBuildContextBundler();
|
|
||||||
|
|
||||||
await startServer();
|
await startServer();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,6 +73,7 @@ export default async function allPagesESBuildContextBundler(params?: Params) {
|
|||||||
],
|
],
|
||||||
jsx: "automatic",
|
jsx: "automatic",
|
||||||
splitting: true,
|
splitting: true,
|
||||||
|
treeShaking: true,
|
||||||
logLevel: "silent",
|
logLevel: "silent",
|
||||||
// logLevel: "silent",
|
// logLevel: "silent",
|
||||||
// logLevel: dev ? "error" : "silent",
|
// logLevel: dev ? "error" : "silent",
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import { log } from "../utils/log";
|
|||||||
import cron from "./server/cron";
|
import cron from "./server/cron";
|
||||||
import type { BuildContext } from "esbuild";
|
import type { BuildContext } from "esbuild";
|
||||||
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
||||||
|
import allPagesESBuildContextBundler from "./bundler/all-pages-esbuild-context-bundler";
|
||||||
|
import serverPostBuildFn from "./server/server-post-build-fn";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* # Declare Global Variables
|
* # Declare Global Variables
|
||||||
@ -60,8 +62,12 @@ export default async function bunextInit() {
|
|||||||
const is_dev = isDevelopment();
|
const is_dev = isDevelopment();
|
||||||
|
|
||||||
if (is_dev) {
|
if (is_dev) {
|
||||||
|
await allPagesESBuildContextBundler({
|
||||||
|
post_build_fn: serverPostBuildFn,
|
||||||
|
});
|
||||||
watcherEsbuildCTX();
|
watcherEsbuildCTX();
|
||||||
} else {
|
} else {
|
||||||
|
await allPagesESBuildContextBundler();
|
||||||
cron();
|
cron();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user