<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vite on Maxime Moreillon</title>
    <link>https://articles.maximemoreillon.com/tags/vite/</link>
    <description>Recent content in Vite on Maxime Moreillon</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 22 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://articles.maximemoreillon.com/tags/vite/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Showing the application version in a Vite-based Vue.js app</title>
      <link>https://articles.maximemoreillon.com/articles/vite-app-version-docker-build-arg/</link>
      <pubDate>Tue, 22 Sep 2026 00:00:00 +0000</pubDate>
      
      <guid>https://articles.maximemoreillon.com/articles/vite-app-version-docker-build-arg/</guid>
      
      <description>&lt;p&gt;This article shows how to set the version of a Vite-based Vue.js app automatically at build time, using a Docker build argument fed by an environment variable provided by CI/CD, such as the Git tag being built.&lt;/p&gt;
&lt;p&gt;It is tempting to read the version from the &lt;code&gt;version&lt;/code&gt; field of &lt;code&gt;package.json&lt;/code&gt; instead, since it is already there. This only works for Node.js projects, though, so the same approach could not be reused for an application written in another language. Relying on a Git tag also means a release does not require cloning the repository and bumping a file locally: it is often just as easy to create the tag from the GitLab UI directly.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Runtime environment variables in a Vue.js app</title>
      <link>https://articles.maximemoreillon.com/articles/vue-runtime-env-window/</link>
      <pubDate>Mon, 21 Sep 2026 00:00:00 +0900</pubDate>
      
      <guid>https://articles.maximemoreillon.com/articles/vue-runtime-env-window/</guid>
      
      <description>&lt;p&gt;In a Vue.js app built with Vite, environment variables such as &lt;code&gt;VITE_API_URL&lt;/code&gt; are read from &lt;code&gt;import.meta.env&lt;/code&gt;. This is convenient, but Vite replaces the &lt;code&gt;VITE_&lt;/code&gt; environment variables with their values during the build. This means they cannot be changed at runtime.&lt;/p&gt;
&lt;p&gt;This article presents a workaround: when the container starts, a small JavaScript file is generated to copy the container&amp;rsquo;s environment variables onto &lt;code&gt;window&lt;/code&gt;. The app then reads its configuration from there.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
