Merge remote changes

This commit is contained in:
Kossi D. T. Saka 2023-01-26 07:37:18 +01:00
commit 639cef9c7d
2 changed files with 23 additions and 21 deletions

View File

@ -37,17 +37,16 @@ const buildOptions = {
...builtins, ...builtins,
], ],
format: "cjs", format: "cjs",
watch: !prod,
target: "es2018", target: "es2018",
logLevel: "info", logLevel: "info",
sourcemap: prod ? false : "inline", sourcemap: prod ? false : "inline",
treeShaking: true, treeShaking: true,
}; };
esbuild const context = await esbuild.context(buildOptions);
.build(buildOptions)
.catch(() => process.exit(1)) if (prod) {
.then(() => { await context.rebuild();
/** /**
* If there is a new version number, copy it to the dist folder * If there is a new version number, copy it to the dist folder
*/ */
@ -62,4 +61,7 @@ esbuild
// Copy the manifest.json file over to the dist folder // Copy the manifest.json file over to the dist folder
copyFileSync(manifestJsonSrc, manifestJsonDist); copyFileSync(manifestJsonSrc, manifestJsonDist);
} }
}); process.exit(0);
} else {
await context.watch();
}

View File

@ -1,6 +1,6 @@
{ {
"name": "obsidian-sample-plugin", "name": "obsidian-sample-plugin",
"version": "1.0.1", "version": "1.0.0",
"description": "This is a sample plugin for Obsidian (https://obsidian.md)", "description": "This is a sample plugin for Obsidian (https://obsidian.md)",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
@ -16,7 +16,7 @@
"@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0", "@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0", "builtin-modules": "3.3.0",
"esbuild": "0.14.47", "esbuild": "0.17.3",
"obsidian": "latest", "obsidian": "latest",
"tslib": "2.4.0", "tslib": "2.4.0",
"typescript": "4.7.4" "typescript": "4.7.4"