2023-05-07 00:14:11 +00:00
|
|
|
const { build, context } = require("esbuild");
|
|
|
|
const { solidPlugin } = require("esbuild-plugin-solid");
|
2023-05-06 11:57:46 +00:00
|
|
|
const path = require("path");
|
|
|
|
const fs = require("fs");
|
2023-05-07 00:14:11 +00:00
|
|
|
const { glob } = require("glob");
|
2023-05-06 11:57:46 +00:00
|
|
|
|
2023-05-07 00:14:11 +00:00
|
|
|
(async() => {
|
|
|
|
const files = await glob("dist/**/*.jsx");
|
2023-05-07 01:31:55 +00:00
|
|
|
console.log(files);
|
2023-05-07 00:14:11 +00:00
|
|
|
const ctx = await context({
|
|
|
|
platform: "node",
|
|
|
|
entryPoints: files,
|
|
|
|
bundle: false,
|
|
|
|
minify: false,
|
|
|
|
logLevel: "info",
|
|
|
|
plugins: [solidPlugin({
|
|
|
|
solid: {
|
|
|
|
generate: "ssr",
|
|
|
|
hydratable: true,
|
|
|
|
},
|
|
|
|
})],
|
2023-05-07 01:31:55 +00:00
|
|
|
outdir: "dist",
|
|
|
|
outbase: "dist",
|
2023-05-07 00:14:11 +00:00
|
|
|
format: "cjs",
|
|
|
|
});
|
|
|
|
|
|
|
|
await ctx.watch();
|
|
|
|
console.log("Watching...");
|
|
|
|
})();
|
|
|
|
|
|
|
|
/*
|
|
|
|
glob("dist/** /*.jsx")
|
2023-05-07 00:06:11 +00:00
|
|
|
.then((files) => {
|
|
|
|
build({
|
2023-05-07 00:14:11 +00:00
|
|
|
platform: "node",
|
2023-05-07 00:06:11 +00:00
|
|
|
entryPoints: files,
|
2023-05-07 00:14:11 +00:00
|
|
|
bundle: false,
|
2023-05-07 00:06:11 +00:00
|
|
|
minify: false,
|
|
|
|
logLevel: "info",
|
|
|
|
plugins: [solidPlugin({
|
|
|
|
solid: {
|
|
|
|
generate: "ssr",
|
|
|
|
hydratable: true,
|
|
|
|
},
|
|
|
|
})],
|
2023-05-07 00:14:11 +00:00
|
|
|
outdir: "dist/src",
|
2023-05-07 00:06:11 +00:00
|
|
|
format: "cjs",
|
|
|
|
});
|
|
|
|
});
|
2023-05-07 00:14:11 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
build({
|
|
|
|
platform: "node",
|
|
|
|
entryPoints: [
|
|
|
|
"src/main.ts",
|
|
|
|
],
|
|
|
|
bundle: true,
|
|
|
|
minify: false,
|
|
|
|
logLevel: "info",
|
|
|
|
plugins: [solidPlugin({
|
|
|
|
solid: {
|
|
|
|
generate: "ssr",
|
|
|
|
hydratable: true,
|
|
|
|
},
|
|
|
|
})],
|
|
|
|
outdir: "dist",
|
|
|
|
format: "cjs",
|
|
|
|
external: [
|
|
|
|
"@nestjs/*",
|
|
|
|
"@fastify/*",
|
|
|
|
"class-validator",
|
|
|
|
"class-transformer",
|
|
|
|
"cache-manager",
|
|
|
|
],
|
|
|
|
});
|
|
|
|
*/
|