9367811c5a
The root cause: Obsidian's plugin loader expects main.js at the plugin root alongside manifest.json. The previous 'dist/' output + shim approach caused 'Cannot find module ./dist/main.js' because dist/ was either missing or not resolved correctly in Obsidian's module loader. Changes: - build: use esbuild to bundle all source into a single main.js (61KB) tsc --noEmit for type checking; esbuild for the actual bundle - main.js: no longer a shim — it's the fully bundled plugin - package.json: added esbuild as devDependency; obsidian moved to devDeps - install.sh: remove dist/ copy step, add cleanup of old dist/ from vault - README.md: updated manual install steps to reflect bundling
40 lines
1.0 KiB
JSON
Executable File
40 lines
1.0 KiB
JSON
Executable File
{
|
|
"name": "ollama-plugin",
|
|
"version": "1.0.0",
|
|
"description": "Ollama integration plugin for Obsidian",
|
|
"main": "dist/main.js",
|
|
"scripts": {
|
|
"test": "jest",
|
|
"build": "tsc --noEmit && node -e \"require('esbuild').build({entryPoints:['src/main.ts'],bundle:true,platform:'node',target:'es2020',outfile:'main.js',external:['obsidian','chromadb'],format:'cjs'})\"",
|
|
"watch": "tsc --watch",
|
|
"lint": "eslint src --ext .ts",
|
|
"format": "prettier --write ."
|
|
},
|
|
"keywords": [
|
|
"obsidian",
|
|
"ollama",
|
|
"chat",
|
|
"ai",
|
|
"plugin"
|
|
],
|
|
"author": "Anonymous",
|
|
"license": "MIT",
|
|
"devDependencies": {
|
|
"@types/jest": "^29.5.14",
|
|
"@types/node": "^20.11.19",
|
|
"@typescript-eslint/eslint-plugin": "^8.59.2",
|
|
"@typescript-eslint/parser": "^8.59.2",
|
|
"esbuild": "^0.28.0",
|
|
"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"
|
|
}
|
|
}
|