Skip to content

Commit 2686894

Browse files
committed
updated build pipeline
`npm run dev` will now build into the example vault
1 parent 9da4a4c commit 2686894

File tree

16 files changed

+2751
-319
lines changed

16 files changed

+2751
-319
lines changed

.gitignore

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1-
# vscode
2-
.vscode
3-
4-
# Intellij
5-
*.iml
6-
.idea
7-
8-
# npm
9-
node_modules
10-
11-
# Don't include the compiled main.js file in the repo.
12-
# They should be uploaded to GitHub releases instead.
13-
main.js
14-
15-
# Exclude sourcemaps
16-
*.map
17-
18-
# obsidian
19-
data.json
20-
21-
# Exclude macOS Finder (System Explorer) View States
22-
.DS_Store
1+
# vscode
2+
.vscode
3+
4+
# Intellij
5+
*.iml
6+
.idea
7+
8+
# npm
9+
node_modules
10+
11+
# Don't include the compiled main.js file in the repo.
12+
# They should be uploaded to GitHub releases instead.
13+
main.js
14+
15+
# Exclude sourcemaps
16+
*.map
17+
18+
# obsidian
19+
data.json
20+
21+
# Exclude macOS Finder (System Explorer) View States
22+
.DS_Store
23+
24+
!exampleVault/.obsidian
25+
26+
exampleVault/.obsidian/*
27+
!exampleVault/.obsidian/plugins
28+
29+
exampleVault/.obsidian/plugins/*
30+
!exampleVault/.obsidian/plugins/obsidian-meta-bind-plugin
31+
!exampleVault/.obsidian/plugins/obsidian-meta-bind-plugin/main.js

esbuild.dev.config.mjs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import esbuild from "esbuild";
2+
import process from "process";
3+
import builtins from 'builtin-modules'
4+
import copy from 'esbuild-plugin-copy-watch'
5+
6+
const banner =
7+
`/*
8+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
9+
if you want to view the source, please visit the github repository of this plugin
10+
*/
11+
`;
12+
13+
const prod = (process.argv[2] === 'production');
14+
15+
esbuild.build({
16+
banner: {
17+
js: banner,
18+
},
19+
entryPoints: ['src/main.ts'],
20+
bundle: true,
21+
external: [
22+
'obsidian',
23+
'electron',
24+
'@codemirror/autocomplete',
25+
'@codemirror/closebrackets',
26+
'@codemirror/collab',
27+
'@codemirror/commands',
28+
'@codemirror/comment',
29+
'@codemirror/fold',
30+
'@codemirror/gutter',
31+
'@codemirror/highlight',
32+
'@codemirror/history',
33+
'@codemirror/language',
34+
'@codemirror/lint',
35+
'@codemirror/matchbrackets',
36+
'@codemirror/panel',
37+
'@codemirror/rangeset',
38+
'@codemirror/rectangular-selection',
39+
'@codemirror/search',
40+
'@codemirror/state',
41+
'@codemirror/stream-parser',
42+
'@codemirror/text',
43+
'@codemirror/tooltip',
44+
'@codemirror/view',
45+
...builtins],
46+
format: 'cjs',
47+
watch: !prod,
48+
target: 'es2016',
49+
logLevel: "info",
50+
sourcemap: prod ? false : 'inline',
51+
treeShaking: true,
52+
outdir: 'exampleVault/.obsidian/plugins/obsidian-meta-bind-plugin/',
53+
outbase: 'src',
54+
plugins: [
55+
copy([
56+
{
57+
from: './styles.css',
58+
to: '',
59+
},
60+
{
61+
from: './manifest.json',
62+
to: '',
63+
},
64+
])
65+
]
66+
}).catch(() => process.exit(1));

exampleVault/.obsidian/plugins/obsidian-meta-bind-plugin/.hotreload

Whitespace-only changes.

0 commit comments

Comments
 (0)