Skip to content

tony19-contrib/vite-base-url-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demonstrates vite's base URL configuration

https://stackoverflow.com/q/68380194/6277151

This project uses ./ as the base URL in production mode (when built), and / in development mode.

Verification steps:

  1. Install dependencies:

    yarn
  2. Build the app:

    yarn build
  3. Open dist/index.html, and verify that the URLs are prefixed with ./ instead of /.

    Screen Shot 2021-07-22 at 4 40 24 PM
  4. Serve the app in production mode:

    yarn serve
  5. Browse to the app, inspect the Vue logo on the home page, and verify that the URL is prefixed with ./ instead of /.

    Screen Shot 2021-07-22 at 4 34 20 PM
  6. Serve the app in development mode:

    yarn dev
  7. Browse to the app, inspect the Vue logo on the home page, and verify that the URL is prefixed with / instead of ./.

    Screen Shot 2021-07-22 at 4 34 05 PM