File tree Expand file tree Collapse file tree 2 files changed +49
-2386
lines changed Expand file tree Collapse file tree 2 files changed +49
-2386
lines changed Original file line number Diff line number Diff line change
1
+ import esbuild from "esbuild" ;
2
+ import process from "process" ;
3
+ import builtins from "builtin-modules" ;
4
+
5
+ const banner =
6
+ `/*
7
+ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
8
+ if you want to view the source, please visit the github repository of this plugin
9
+ */
10
+ ` ;
11
+
12
+ const prod = ( process . argv [ 2 ] === "production" ) ;
13
+
14
+ const context = await esbuild . context ( {
15
+ banner : {
16
+ js : banner ,
17
+ } ,
18
+ entryPoints : [ "main.ts" ] ,
19
+ bundle : true ,
20
+ external : [
21
+ "obsidian" ,
22
+ "electron" ,
23
+ "@codemirror/autocomplete" ,
24
+ "@codemirror/collab" ,
25
+ "@codemirror/commands" ,
26
+ "@codemirror/language" ,
27
+ "@codemirror/lint" ,
28
+ "@codemirror/search" ,
29
+ "@codemirror/state" ,
30
+ "@codemirror/view" ,
31
+ "@lezer/common" ,
32
+ "@lezer/highlight" ,
33
+ "@lezer/lr" ,
34
+ ...builtins ] ,
35
+ format : "cjs" ,
36
+ target : "es2018" ,
37
+ logLevel : "info" ,
38
+ sourcemap : prod ? false : "inline" ,
39
+ treeShaking : true ,
40
+ outfile : "main.js" ,
41
+ minify : prod ,
42
+ } ) ;
43
+
44
+ if ( prod ) {
45
+ await context . rebuild ( ) ;
46
+ process . exit ( 0 ) ;
47
+ } else {
48
+ await context . watch ( ) ;
49
+ }
You can’t perform that action at this time.
0 commit comments