eeg_nest/esbuild.js
2023-05-06 19:14:11 -05:00

76 lines
1.6 KiB
JavaScript

const { build, context } = require("esbuild");
const { solidPlugin } = require("esbuild-plugin-solid");
const path = require("path");
const fs = require("fs");
const { glob } = require("glob");
(async() => {
const files = await glob("dist/**/*.jsx");
const ctx = await context({
platform: "node",
entryPoints: files,
bundle: false,
minify: false,
logLevel: "info",
plugins: [solidPlugin({
solid: {
generate: "ssr",
hydratable: true,
},
})],
outdir: "dist/src",
format: "cjs",
});
await ctx.watch();
console.log("Watching...");
})();
/*
glob("dist/** /*.jsx")
.then((files) => {
build({
platform: "node",
entryPoints: files,
bundle: false,
minify: false,
logLevel: "info",
plugins: [solidPlugin({
solid: {
generate: "ssr",
hydratable: true,
},
})],
outdir: "dist/src",
format: "cjs",
});
});
*/
/*
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",
],
});
*/