Reputation: 1
Does anyone know how I'll be able to import my external CSS and JS files into Astro's new version? I tried:
<link rel="stylesheet" href={Astro.resolve('../styles/style.css')}>
But it's not workings anymore after Astro's new 1.0 Update launch.
Upvotes: 0
Views: 6298
Reputation: 21
Astro.resolve
has been deprecated as you can see in detail in the documentation.
Summary of the recommended ESM Import method:
.css
file inside the src/
directory.astro
file:---
// Example: Astro will include and optimize this CSS for you automatically
import './style.css';
---
<html><!-- Your page here --></html>
Upvotes: 2
Reputation: 204
If you place your style sheet in the public
folder, you can simply import it using:
<link rel="stylesheet" href="index.css" />
Upvotes: 0