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:
@@ -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
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user