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.
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.
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>
If you place your style sheet in the public
folder, you can simply import it using:
<link rel="stylesheet" href="index.css" />