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! (6 Comments)

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

  1. Commented 6 months 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 6 months 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 6 months 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 6 months ago

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

      0

      Please sign in or sign up for free to reply

  3. Commented 2 months ago

    It's been nearly a year since you published this so maybe you're already aware, Vite is French for "quick" and is pronounced "veet" … just for future videos etc.

    1

    Please sign in or sign up for free to reply

    1. Commented 2 months ago

      Thank you, secondman!! Yeah, the folks in the YouTube comments quickly provided feedback when this lesson was released. My pronunciation should be fixed from, I believe, this lesson onward.

      0

      Please sign in or sign up for free to reply

Playing Next Lesson In
seconds