Skip to content

Commit

Permalink
0.5.0 open source release
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-cen committed Nov 20, 2022
1 parent 724a4b6 commit a1fec0d
Show file tree
Hide file tree
Showing 75 changed files with 12,795 additions and 2,436 deletions.
71 changes: 71 additions & 0 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import esbuild from "esbuild";
import process from "process";
import builtins from 'builtin-modules'
import fs from 'fs'
import { copy } from 'esbuild-plugin-copy';
import * as dotenv from 'dotenv'
dotenv.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 demo = (process.argv[2] === 'demo');
const prod = (process.argv[2] === 'production');

let renamePlugin = {
name: 'rename-styles',
setup(build) {
build.onEnd(() => {
const { outfile } = build.initialOptions;
const outcss = outfile.replace(/\.js$/, '.css');
const fixcss = outfile.replace(/main\.js$/, 'styles.css');
if (fs.existsSync(outcss)) {
console.log('Renaming', outcss, 'to', fixcss);
fs.renameSync(outcss, fixcss);
}
});
},
};


const outputDir = prod ? process.env.buildDir : demo ? process.env.demoDir : process.env.devDir
esbuild.build({
banner: {
js: banner,
},
entryPoints: ['main.ts'],
bundle: true,
external: [
'obsidian',
'electron',
'@codemirror/autocomplete',
'@codemirror/collab',
'@codemirror/commands',
'@codemirror/language',
'@codemirror/lint',
'@codemirror/search',
'@codemirror/state',
'@codemirror/view',
...builtins],
format: 'cjs',
watch: !prod,
target: 'es2018',
logLevel: "info",
sourcemap: prod ? false : 'inline',
treeShaking: true,
outfile: outputDir+'/main.js',
plugins: [renamePlugin,
...(prod ? [copy({
resolveFrom: 'cwd',
assets: {
from: ['./manifest.json'],
to: [outputDir+'/manifest.json'],
},
})] : []),
],
}).catch(() => process.exit(1));

1 change: 1 addition & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.css';
4,134 changes: 1,702 additions & 2,432 deletions main.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "make-md",
"name": "MAKE.md",
"version": "0.4.9",
"version": "0.5.0",
"minAppVersion": "0.16.0",
"description": "This distribution makes Obsidian easy to use.",
"description": "The ultimate experience for makers on Obsidian",
"author": "MAKE.md",
"authorUrl": "https://www.make.md",
"isDesktopOnly": false
Expand Down
Loading

0 comments on commit a1fec0d

Please sign in to comment.