How to configure the assets so I can reference it?

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';

image

CSS needs to be in the styles.css file, not loaded via JS

Thanks your reply, can I configure the assets directory to get the static files?

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.

Thanks your reply, do you mean not even in development enviroment?

Well, there are ways around it, but those will cause your plugin to break for everyone else that downloads the plugin.