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-17 18:04:11 +00:00
|
|
|
/**
|
|
|
|
* Compile JSX files
|
|
|
|
*/
|
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();
|
2023-05-17 18:04:11 +00:00
|
|
|
console.log("Watching Solid JSX...");
|
2023-05-07 00:14:11 +00:00
|
|
|
})();
|
|
|
|
|
2023-05-17 18:04:11 +00:00
|
|
|
/**
|
|
|
|
* Generate hydration script
|
|
|
|
*/
|
|
|
|
(async () => {
|
|
|
|
const ctx = await context({
|
|
|
|
platform: "browser",
|
|
|
|
entryPoints: [
|
|
|
|
"src/views/hydration.ts",
|
|
|
|
],
|
|
|
|
bundle: true,
|
|
|
|
minify: false,
|
|
|
|
logLevel: "info",
|
|
|
|
plugins: [
|
|
|
|
solidPlugin({
|
2023-05-07 00:06:11 +00:00
|
|
|
solid: {
|
2023-05-17 18:04:11 +00:00
|
|
|
generate: "dom",
|
2023-05-07 00:06:11 +00:00
|
|
|
hydratable: true,
|
|
|
|
},
|
2023-05-17 18:04:11 +00:00
|
|
|
})
|
|
|
|
],
|
|
|
|
outdir: "static",
|
|
|
|
format: "cjs",
|
2023-05-07 00:06:11 +00:00
|
|
|
});
|
2023-05-07 00:14:11 +00:00
|
|
|
|
2023-05-17 18:04:11 +00:00
|
|
|
await ctx.watch();
|
|
|
|
console.log("Watching hydration script...");
|
|
|
|
})();
|
2023-06-12 03:25:18 +00:00
|
|
|
|
|
|
|
(async () => {
|
|
|
|
const ctx = await context({
|
|
|
|
platform: "browser",
|
|
|
|
entryPoints: [
|
|
|
|
"src/views/hydration/hydration_aulavirtual.ts",
|
|
|
|
],
|
|
|
|
bundle: true,
|
|
|
|
minify: false,
|
|
|
|
logLevel: "info",
|
|
|
|
plugins: [
|
|
|
|
solidPlugin({
|
|
|
|
solid: {
|
|
|
|
generate: "dom",
|
|
|
|
hydratable: true,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
],
|
|
|
|
outdir: "static",
|
|
|
|
format: "cjs",
|
|
|
|
});
|
|
|
|
|
|
|
|
await ctx.watch();
|
|
|
|
console.log("Watching hydration script...");
|
|
|
|
})();
|