mirror of
https://github.com/kev-cao/obsidian-flexical.git
synced 2026-07-22 07:48:36 +00:00
fix: bundle React via preact/compat to satisfy plugin review
react-dom emits three dynamic createElement("script") calls (its
hoistable-resource code paths) that Obsidian's review scanner flags,
even though the plugin never triggers them. Alias react/react-dom to
preact/compat at bundle time so those code paths are gone; also shrinks
main.js from ~4MB to ~130K.
Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
This commit is contained in:
parent
551d6f367e
commit
fa35bf9d20
3 changed files with 20 additions and 0 deletions
|
|
@ -19,6 +19,13 @@ const context = await esbuild.context({
|
|||
styles: 'src/styles/main.css',
|
||||
},
|
||||
bundle: true,
|
||||
alias: {
|
||||
'react': 'preact/compat',
|
||||
'react-dom': 'preact/compat',
|
||||
'react-dom/client': 'preact/compat/client',
|
||||
'react/jsx-runtime': 'preact/jsx-runtime',
|
||||
'react/jsx-dev-runtime': 'preact/jsx-dev-runtime',
|
||||
},
|
||||
external: [
|
||||
'obsidian',
|
||||
'electron',
|
||||
|
|
|
|||
12
package-lock.json
generated
12
package-lock.json
generated
|
|
@ -27,6 +27,7 @@
|
|||
"globals": "^17.6.0",
|
||||
"jiti": "^2.6.1",
|
||||
"obsidian": "latest",
|
||||
"preact": "^10.29.2",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.59.1"
|
||||
}
|
||||
|
|
@ -4105,6 +4106,17 @@
|
|||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/preact": {
|
||||
"version": "10.29.2",
|
||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.29.2.tgz",
|
||||
"integrity": "sha512-7tNmwg/7mzzAoB/8kSg6Hl37JraAZw3Z3A0JSY7VXlZwo82Xn0G7wKbNNs2qoF4ZEEsQGTwDAroNdqKs1ofJxQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/preact"
|
||||
}
|
||||
},
|
||||
"node_modules/prelude-ls": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
"globals": "^17.6.0",
|
||||
"jiti": "^2.6.1",
|
||||
"obsidian": "latest",
|
||||
"preact": "^10.29.2",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.59.1"
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue