Skip to content

Commit

Permalink
fix: Fixes module building
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Apr 22, 2024
1 parent d7b42bc commit 5b6210f
Show file tree
Hide file tree
Showing 9 changed files with 665 additions and 1,618 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,11 @@ jobs:
runs-on: ubuntu-latest
needs: upload-build
steps:
- name: Webhook
uses: javalent/workflows/actions/discord-embed@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Dice Roller
repo: dice-roller
webhook-urls: ${{ secrets.TTRPG_WEBHOOK }}
publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
uses: javalent/workflows/.github/workflows/publish.yml@main
secrets: inherit
- name: Webhook
uses: javalent/workflows/actions/discord-embed@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Dice Roller
repo: dice-roller
webhook-urls: ${{ secrets.TTRPG_WEBHOOK }}
41 changes: 20 additions & 21 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
import sveltePlugin from "esbuild-svelte";
import sveltePreprocess from "svelte-preprocess";
import path from "path";
import { copyFile } from "fs/promises";
import { config } from "dotenv";
import { build } from "tsup";

config();

Expand Down Expand Up @@ -50,28 +51,31 @@ const parameters = {
"@codemirror/tooltip",
"@codemirror/view",
"moment",
"@javalent/components/svelte",
...builtins
],
format: "cjs",
target: "es2022",
logLevel: "info",
sourcemap: prod ? false : "inline",
minify: prod,
minify: true,
treeShaking: true,
outdir: dir,

conditions: ["svelte"],
plugins: [
sveltePlugin({
compilerOptions: { css: "injected" },
preprocess: sveltePreprocess(),
filterWarnings: (warning) => {
if (warning.code.toLowerCase().startsWith("a11y-")) {
return false;
}
return true;
}
})
],
logOverride: { "empty-import-meta": "silent" }
};

await esbuild.build(parameters).catch((x) => {
if (x.errors) {
console.error(x.errors);
} else {
console.error(x);
}
process.exit(1);
});

if (prod) {
await esbuild.build(parameters).catch((x) => {
if (x.errors) {
Expand All @@ -81,14 +85,9 @@ if (prod) {
}
process.exit(1);
});
await build({
entry: ["./src/api/api.ts"],
dts: {
only: true
}
});
await build({
entry: ["./src/types/api.ts"]
await esbuild.build({
entryPoints: ["./src/types/api.ts"],
outdir: "./dist"
});
} else {
let ctx = await esbuild.context(parameters);
Expand Down
Loading

0 comments on commit 5b6210f

Please sign in to comment.