Skip to content

Commit

Permalink
rolup depracation for esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGB committed Jan 19, 2024
1 parent c49df71 commit 2892f0b
Show file tree
Hide file tree
Showing 21 changed files with 5,031 additions and 3,057 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
id: build
run: |
npm install
npm run build -- --environment BUILD:production
npm run release
# Create the release on github
- name: Create Release
id: create_release
Expand Down
67 changes: 67 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";

const banner =
`/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
`;

const prod = (process.argv[2] === "production");

const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/closebrackets",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/comment",
"@codemirror/fold",
"@codemirror/gutter",
"@codemirror/highlight",
"@codemirror/history",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/matchbrackets",
"@codemirror/panel",
"@codemirror/rangeset",
"@codemirror/rectangular-selection",
"@codemirror/search",
"@codemirror/state",
"@codemirror/stream-parser",
"@codemirror/text",
"@codemirror/tooltip",
"@codemirror/view",
"@codemirror/basic-setup",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins,
],
format: "cjs",
target: "ES6",
logLevel: "info",
sourcemap: prod ? false : "inline",
minify: prod ? true : false,
treeShaking: true,
outfile: "dist/main.js",
loader: {
".ttf": "file",
},
});

if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}
2 changes: 1 addition & 1 deletion manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "dbfolder",
"name": "DB Folder",
"version": "3.5.0",
"version": "3.5.1",
"minAppVersion": "1.1.1",
"description": "Folder with the capability to store and retrieve data from a folder like database",
"author": "RafaelGB",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "dbfolder",
"name": "DB Folder",
"version": "3.5.0",
"version": "3.5.1`",
"minAppVersion": "1.1.1",
"description": "Folder with the capability to store and retrieve data from a folder like database",
"author": "RafaelGB",
Expand Down
Loading

0 comments on commit 2892f0b

Please sign in to comment.