Skip to content

Commit 9f00e07

Browse files
Merge Issue#1 bugfix
Issue#1 bugfix
2 parents b1a77f8 + 412f12e commit 9f00e07

File tree

8 files changed

+264
-281
lines changed

8 files changed

+264
-281
lines changed

esbuild.config.mjs

Lines changed: 33 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -24,77 +24,42 @@ const renameImportPlugin = {
2424
},
2525
};
2626

27-
const nativeNodeModulesPlugin = {
28-
name: 'native-node-modules',
29-
setup(build) {
30-
// If a ".node" file is imported within a module in the "file" namespace, resolve
31-
// it to an absolute path and put it into the "node-file" virtual namespace.
32-
build.onResolve({ filter: /\.node$/, namespace: 'file' }, args => ({
33-
path: require.resolve(args.path, { paths: [args.resolveDir] }),
34-
namespace: 'node-file',
35-
}))
36-
37-
// Files in the "node-file" virtual namespace call "require()" on the
38-
// path from esbuild of the ".node" file in the output directory.
39-
build.onLoad({ filter: /.*/, namespace: 'node-file' }, args => ({
40-
contents: `
41-
import path from ${JSON.stringify(args.path)}
42-
try { module.exports = require(path) }
43-
catch {}
44-
`,
45-
}))
46-
47-
// If a ".node" file is imported within a module in the "node-file" namespace, put
48-
// it in the "file" namespace where esbuild's default loading behavior will handle
49-
// it. It is already an absolute path since we resolved it to one above.
50-
build.onResolve({ filter: /\.node$/, namespace: 'node-file' }, args => ({
51-
path: args.path,
52-
namespace: 'file',
53-
}))
54-
55-
// Tell esbuild's default loading behavior to use the "file" loader for
56-
// these ".node" files.
57-
let opts = build.initialOptions
58-
opts.loader = opts.loader || {}
59-
opts.loader['.node'] = 'file'
60-
},
61-
}
62-
63-
6427
esbuild.build({
6528
banner: {
6629
js: banner,
6730
},
6831
loader: { ".node": "file" },
69-
bundle: true,
70-
entryPoints: ['src/plugin/main.ts'],
71-
external: [
72-
'obsidian',
73-
'electron',
74-
'codemirror',
75-
'@codemirror/autocomplete',
76-
'@codemirror/closebrackets',
77-
'@codemirror/commands',
78-
'@codemirror/fold',
79-
'@codemirror/gutter',
80-
'@codemirror/history',
81-
'@codemirror/language',
82-
'@codemirror/rangeset',
83-
'@codemirror/rectangular-selection',
84-
'@codemirror/search',
85-
'@codemirror/state',
86-
'@codemirror/stream-parser',
87-
'@codemirror/text',
88-
'@codemirror/view',
89-
...builtins,
90-
],
91-
format: 'cjs',
92-
logLevel: 'info',
93-
minify: prod,
94-
outfile: 'main.js',
95-
sourcemap: prod ? false : 'inline',
96-
target: 'es2016',
97-
treeShaking: true,
32+
bundle: true,
33+
entryPoints: ['src/plugin/main.ts'],
34+
external: [
35+
'obsidian',
36+
'electron',
37+
'codemirror',
38+
'@codemirror/autocomplete',
39+
'@codemirror/closebrackets',
40+
'@codemirror/commands',
41+
'@codemirror/fold',
42+
'@codemirror/gutter',
43+
'@codemirror/history',
44+
'@codemirror/language',
45+
'@codemirror/rangeset',
46+
'@codemirror/rectangular-selection',
47+
'@codemirror/search',
48+
'@codemirror/state',
49+
'@codemirror/stream-parser',
50+
'@codemirror/text',
51+
'@codemirror/view',
52+
...builtins,
53+
],
54+
format: 'cjs',
55+
logLevel: 'info',
56+
minify: prod,
57+
minifySyntax: prod,
58+
minifyWhitespace: prod,
59+
minifyIdentifiers: prod,
60+
outfile: 'main.js',
61+
sourcemap: prod ? false: "inline",
62+
target: 'es2016',
63+
treeShaking: true,
9864
plugins: [renameImportPlugin]
99-
})
100-
.catch(() => process.exit(1));
65+
}).catch(() => process.exit(1));

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "ical-obsidian-sync",
33
"name": "iCalSync",
4-
"version": "1.1.3",
4+
"version": "1.1.4",
55
"minAppVersion": "0.15.0",
66
"description": "Synchronize iCalendar with your notes",
77
"author": "Vaccarini Lorenzo",

0 commit comments

Comments
 (0)