pqina / svelte-filepond

🔌 A handy FilePond adapter component for Svelte
MIT License
247 stars 10 forks source link

404's on CSS files in sapper #6

Open MTyson opened 3 years ago

MTyson commented 3 years ago

Describe the bug

Following the example in this repo, I get 404s when importing the CSS files:

Logs

GET http://localhost:3000/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css net::ERR_ABORTED 404 (Not Found)
create:1 GET http://localhost:3000/filepond/dist/filepond.min.css net::ERR_ABORTED 404 (Not Found)

This may be something I'm doing dumb rather than a bug.

MTyson commented 3 years ago

I worked around this by changing the import in Component.svelte to:

import '../../filepond/dist/filepond.min.css';

In the script tag.

rikschennink commented 3 years ago

@MTyson thanks, will look into this when I have some time.

MTyson commented 3 years ago

Thanks for the component, it is working great now @rikschennink

hobbitronics commented 3 years ago

I am having the same issue getting the css to work as shown in the docs. Tanks for the workaround MTyson.

MTyson commented 3 years ago

I had to pull the code into my project because when building to production, the workaround is lost.

rikschennink commented 3 years ago

I've restructured the component, hope that helps. The css import is now separate from the Svelte component and no longer in the <style> tag, this seems to work in my test. Published as 0.2.0

import 'filepond/dist/filepond.min.css';
MTyson commented 3 years ago

Awesome, thanks again.