diff --git a/.gitignore b/.gitignore index cf2b6162..dcd9090e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ commit.txt .pnp.loader.mjs .env static/dist +static/bundles cypress/screenshots cypress/videos diff --git a/build/esbuild-build.ts b/build/esbuild-build.ts index 2935e194..6745aa70 100644 --- a/build/esbuild-build.ts +++ b/build/esbuild-build.ts @@ -17,10 +17,26 @@ export const esBuildContext: esbuild.BuildOptions = { ".ttf": "dataurl", ".svg": "dataurl", }, - outdir: "static/out", + outfile: "static/bundles/bundles.js", + entryNames: "bundles", // Ensure the CSS is named bundles.css define: createEnvDefines(["SUPABASE_URL", "SUPABASE_ANON_KEY"], { commitHash: execSync(`git rev-parse --short HEAD`).toString().trim(), }), + plugins: [ + { + name: "css-bundle", + setup(build) { + build.onEnd((result) => { + execSync(`cat static/styles/rewards/pay.css > static/bundles/bundles.css`); + execSync(`cat static/styles/rewards/background.css >> static/bundles/bundles.css`); + execSync(`cat static/styles/toast.css >> static/bundles/bundles.css`); + execSync(`cat static/styles/rewards/claim-table.css >> static/bundles/bundles.css`); + execSync(`cat static/styles/rewards/media-queries.css >> static/bundles/bundles.css`); + execSync(`cat static/styles/rewards/light-mode.css >> static/bundles/bundles.css`); + }); + }, + }, + ], }; esbuild diff --git a/static/index.html b/static/index.html index 9bbb8acc..44363c76 100644 --- a/static/index.html +++ b/static/index.html @@ -2,12 +2,7 @@
- - - - - - + @@ -196,7 +191,7 @@