Vite and Our Assets

In this lesson, we'll learn how Vite is integrating into our EdgeJS views to serve our JavaScript and CSS files.

Published
Jan 24
Duration
6m 39s

Developer, dog lover, and burrito eater. Currently teaching AdonisJS, a fully featured NodeJS framework, and running Adocasts where I post new lessons weekly. Professionally, I work with JavaScript, .Net C#, and SQL Server.

Adocasts

Burlington, KY

Join The Discussion! (4 Comments)

Please sign in or sign up for free to join in on the dicussion.

  1. Commented 1 month ago

    Does the import of external asset files (CSS, JS, and fonts) follow the same procedure?

    1

    Please sign in or sign up for free to reply

    1. Commented 1 month ago

      External assets as in from a CDN? No, you should just be able to plop the <link/> or <script> for those directly within your EdgeJS page/layout.

      If the assets are being handled by Vite, then yes the process will be the same. You can also use the asset() helper to reach for specific files as well.

      https://docs.adonisjs.com/guides/basics/vite#referencing-assets-inside-edge-templates

      0

      Please sign in or sign up for free to reply

  2. Commented 1 month ago

    I setup a project for adonisjs from scatch and it seems to be already following the 2 separate entrypoints for app.css and app.js

    1

    Please sign in or sign up for free to reply

    1. Commented 1 month ago

      Yep! Looks like they updated this with their recent Vite updates.

      0

      Please sign in or sign up for free to reply

Playing Next Lesson In
seconds