Skip to content

Commit

Permalink
fix: Significant improvements to the publish feature for code blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Mar 14, 2022
1 parent e4aa52f commit ce644a5
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 587 deletions.
41 changes: 41 additions & 0 deletions esbuild.publish.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
import { config } from "dotenv";
import { sassPlugin } from "esbuild-sass-plugin";

config();

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 dir = prod ? "./" : process.env.OUTDIR;

esbuild
.build({
banner: {
js: banner
},
entryPoints: ["src/publish/publish.admonition.ts"],
bundle: true,
external: ["obsidian", "electron"],
format: "cjs",
watch: !prod,
minify: prod,
target: "es2020",
logLevel: "info",
sourcemap: !prod ? "inline" : false,
treeShaking: true,
outfile: "./publish/publish.admonition.txt",
define: {
ADMONITION_ICON_MAP: "ADMONITION_ICON_MAP"
},
tsconfig: "./src/publish/tsconfig.json",
plugins: [sassPlugin()]
})
.catch(() => process.exit(1));
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "node ./esbuild.config.mjs",
"build": "node ./esbuild.config.mjs production",
"publish": "node ./esbuild.publish.mjs production",
"release": "standard-version"
},
"standard-version": {
Expand Down
264 changes: 1 addition & 263 deletions publish/publish.admonition.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ce644a5

Please sign in to comment.