markleo
November 13, 2025, 7:30am
1
I need to place static resources in the assets folder when developing a plugin, how should I configure the assets?
I have a scenario where I need to use some static resources such as images and SVGs, and I want to put them in the assets folder.
I’ve tried using relative paths to import them, but when actually running the plugin, the files cannot be referenced correctly.
const STATIC_CSS = './assets/static.min.css';
joethei
November 13, 2025, 9:46am
2
CSS needs to be in the styles.css file, not loaded via JS
markleo
November 13, 2025, 9:52am
3
Thanks your reply, can I configure the assets directory to get the static files?
joethei
November 13, 2025, 10:11am
4
Obsidian requires 3 files, manifest.json, main.js and styles.css, everything else will be ignored.
Once you release your plugin, these 3 files will be what you need to attach to the release.
markleo
November 13, 2025, 10:33am
5
Thanks your reply, do you mean not even in development enviroment?
joethei
November 13, 2025, 1:27pm
6
Well, there are ways around it, but those will cause your plugin to break for everyone else that downloads the plugin.