We're using Vite and enjoying it, would you say much of Vite could be replaced with pure esbuild?
I guess Vite provides a nice development experience but is built on esbuild.
I guess Vite provides a nice development experience but is built on esbuild.
I'm also a huge fan of HMR, and esbuild in the past has been anti-HMR.
The config is beyond minimal. If you're using webpack you may want to look away now :-)
import { resolve } from 'path'
import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
export default defineConfig({
plugins: [reactRefresh()],
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'index.html'),
}
},
sourcemap: true
},
esbuild: {
jsxInject: `import * as React from "react"`
},
resolve: {
alias: [
{ find: '@', replacement: '/src' },
]
},
})