'external' node modules in Plugins

I am developing a plugin that has a dependency or two that are recommended to be made ‘external’ when bundling. I think this is because there are some binaries or native bindings that are included as a part of the dependency. In other words, I’d be adding them to this area in the esbuild.config.mjs file:

...
	external: [
		"obsidian",
		"electron",
		"@codemirror/autocomplete",
		"@codemirror/collab",
		"@codemirror/commands",
		"@codemirror/language",
		"@codemirror/lint",
		"@codemirror/search",
		"@codemirror/state",
		"@codemirror/view",
		"@lezer/common",
		"@lezer/highlight",
		"@lezer/lr",
		...builtins],

My question is: will this work once the plugin is published? How are modules loaded for plugins? If there is relevant documentation please feel free to point me to it as I didn’t see any outright.

Thanks in advance!

What dependencies are you talking about?
If we don’t have them in our runtime dependencies, then they can’t be loaded in a plugin if they are not bundled.

I’m referring to the node modules that the plugin requires. I think this answers my question, thank you!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.