0

In the svelte example app there are imports like this:

import './app.css'
import svelteLogo from './assets/svelte.svg'

I could not find an explanation on the official documentation.

I am guessing that this is a svelte and not a js feature?

Which files can you import? And how do they get imported, e.g. import './app.css' applies the stylesheet and import svelteLogo from './assets/svelte.svg' appears to save the path in svelteLogo.

I searched "Svelte Import Files other than JavaScript", "js import files" and searched on https://svelte.dev/docs.

1 Answer 1

3

It has nothing to do with Svelte or JS, it's something build tools provide.
Common types may be supported out of the box while others require plugins/loaders.

SvelteKit e.g. uses Vite but there are others like Webpack or Parcel.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.