fix: move obsidian to devDependencies, improve shim export

- package.json: move obsidian from dependencies to devDependencies
  (it is a type stub — having it in dependencies risks shadowing
  Obsidian's built-in API if node_modules is present in the plugin folder)
- main.js: explicitly extract default export from dist/main.js so the
  shim works with both plugin.default and direct-export loader patterns
This commit is contained in:
2026-05-19 18:21:17 +02:00
parent 44cff07ea1
commit 4ea2734ade
2 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -1,3 +1,4 @@
// Shim entry point — re-exports the compiled plugin from dist/
// Obsidian expects main.js at the plugin root alongside manifest.json.
module.exports = require('./dist/main.js');
// Shim entry point — Obsidian expects main.js at the plugin root.
// Re-exports the compiled plugin from dist/, handling both default and named exports.
const plugin = require('./dist/main.js');
module.exports = plugin.default || plugin;
+2 -2
View File
@@ -27,12 +27,12 @@
"eslint": "^8.56.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^30.3.0",
"obsidian": "^1.4.11",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"typescript": "^5.3.3"
},
"dependencies": {
"chromadb": "^1.5.3",
"obsidian": "^1.4.11"
"chromadb": "^1.5.3"
}
}