<?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 David Lang</title>
    <link>https://www.davidlang.tech/tags/vite/</link>
    <description>Recent content in Vite on David Lang</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 08 Feb 2022 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.davidlang.tech/tags/vite/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Vite vs Webpack: Why Developers Are Switching</title>
      <link>https://www.davidlang.tech/posts/vite-vs-webpack-why-developers-are-switching/</link>
      <pubDate>Tue, 08 Feb 2022 00:00:00 +0000</pubDate>
      <guid>https://www.davidlang.tech/posts/vite-vs-webpack-why-developers-are-switching/</guid>
      <description>&lt;p&gt;Vite uses native ES modules in development for near-instant cold starts. Webpack remains ubiquitous in enterprise codebases-but Vite won the greenfield race by 2022.&lt;/p&gt;&#xA;&lt;h2 id=&#34;development-experience&#34;&gt;Development Experience&lt;/h2&gt;&#xA;&lt;p&gt;Vite serves source files directly; the browser requests modules on demand. Webpack bundles the entire graph before serving-slower as projects grow.&lt;/p&gt;&#xA;&lt;h2 id=&#34;production-builds&#34;&gt;Production Builds&lt;/h2&gt;&#xA;&lt;p&gt;Vite uses Rollup for optimized production bundles. Tree-shaking, code splitting, and asset handling are comparable to Webpack 5.&lt;/p&gt;&#xA;&lt;h2 id=&#34;migration-tips&#34;&gt;Migration Tips&lt;/h2&gt;&#xA;&lt;p&gt;Replace &lt;code&gt;webpack.config.js&lt;/code&gt; with &lt;code&gt;vite.config.ts&lt;/code&gt;. Use &lt;code&gt;import.meta.env&lt;/code&gt; instead of &lt;code&gt;process.env&lt;/code&gt; for env variables. Check plugins-most popular React libraries ship Vite templates.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
