refactor: remove save on build on next app and integrate turbopack

This commit is contained in:
Mauricio Siu
2024-10-24 23:13:24 -06:00
parent cb586c9b74
commit 47aa223f87
93 changed files with 810 additions and 303 deletions

View File

@@ -1,28 +1,28 @@
// import { build } from "esbuild";
// import alias from "esbuild-plugin-alias";
// import path from "node:path";
// import { fileURLToPath } from "node:url";
// const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
// const __dirname = path.dirname(__filename);
import path from "node:path";
import { fileURLToPath } from "node:url";
import { build } from "esbuild";
import alias from "esbuild-plugin-alias";
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
const __dirname = path.dirname(__filename);
// build({
// entryPoints: ["./src/**/*.ts"],
// // outfile: "./dist/index.js",
// outdir: "./dist",
// bundle: true,
// minify: false,
// platform: "node",
// target: "esnext",
// format: "esm",
// plugins: [
// alias({
// "@/server": path.resolve(__dirname, "src"),
// }),
// ],
// packages: "external",
// // Opcional: si deseas emitir declaraciones de tipos con esbuild-plugin-dts
// })
// .then(() => {
// console.log("Build successful");
// })
// .catch(() => process.exit(1));
build({
entryPoints: ["./src/**/*.ts"],
// outfile: "./dist/index.js",
outdir: "./dist",
bundle: true,
minify: false,
platform: "node",
target: "esnext",
format: "esm",
plugins: [
alias({
"@dokploy/server": path.resolve(__dirname, "src"),
}),
],
packages: "external",
// Opcional: si deseas emitir declaraciones de tipos con esbuild-plugin-dts
})
.then(() => {
console.log("Build successful");
})
.catch(() => process.exit(1));