@jmlweb/vite-config 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @jmlweb/vite-config
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 4a9ece1: Update documentation to use pnpm commands instead of npm
8
+
3
9
  ## 0.1.3
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -19,13 +19,13 @@
19
19
  ## 📦 Installation
20
20
 
21
21
  ```bash
22
- npm install --save-dev @jmlweb/vite-config vite
22
+ pnpm add -D @jmlweb/vite-config vite
23
23
  ```
24
24
 
25
25
  For React projects, also install the React plugin:
26
26
 
27
27
  ```bash
28
- npm install --save-dev @vitejs/plugin-react
28
+ pnpm add -D @vitejs/plugin-react
29
29
  ```
30
30
 
31
31
  > 💡 **Upgrading from a previous version?** See the [Migration Guide](#-migration-guide) for breaking changes and upgrade instructions.
@@ -181,6 +181,38 @@ export default createViteConfig({
181
181
  });
182
182
  ```
183
183
 
184
+ ## 🤔 Why Use This?
185
+
186
+ > **Philosophy**: Modern build tools should provide instant feedback during development and optimized production builds with zero configuration.
187
+
188
+ This package provides a Vite configuration that balances development speed with production optimization. It leverages Vite's native ESM dev server for instant HMR and esbuild for ultra-fast production builds, while remaining flexible enough for any project type.
189
+
190
+ ### Design Decisions
191
+
192
+ **ESBuild Minification (`minify: 'esbuild'`)**: Fast production builds
193
+
194
+ - **Why**: esbuild is orders of magnitude faster than terser while producing comparably small bundles. For most projects, the speed improvement far outweighs the minimal size difference. This keeps build times fast even for large applications
195
+ - **Trade-off**: Terser can sometimes achieve slightly smaller bundles (1-3%). But esbuild's speed is almost always worth it
196
+ - **When to override**: For bundle size-critical applications where every byte matters, consider terser. But try esbuild first
197
+
198
+ **ESNext Target (`target: 'esnext'`)**: Modern JavaScript output
199
+
200
+ - **Why**: Vite assumes modern browsers by default. Using esnext target produces the smallest, most performant code because it doesn't transpile modern features browsers already support. Your bundler only polyfills what's actually needed
201
+ - **Trade-off**: Won't work in older browsers without additional configuration. But Vite is designed for modern development
202
+ - **When to override**: For projects supporting older browsers - set specific targets like `['es2020', 'chrome87', 'firefox78']`
203
+
204
+ **No Source Maps by Default (`sourcemap: false`)**: Faster production builds
205
+
206
+ - **Why**: Source maps are valuable for debugging but significantly increase build time and bundle size. Most production deployments don't need them. Enable per-project when needed for production debugging or error tracking services
207
+ - **Trade-off**: Harder to debug production issues. But you can enable source maps easily when needed
208
+ - **When to override**: For production debugging or when using error tracking services (Sentry, etc.) - set `sourcemap: true`
209
+
210
+ **Port Flexibility (`strictPort: false`)**: Development convenience
211
+
212
+ - **Why**: If the default port is in use, Vite automatically finds an available port instead of failing. This is convenient when running multiple projects or when the port is already taken
213
+ - **Trade-off**: Port might change between runs if default is busy. But Vite tells you the actual port
214
+ - **When to override**: For projects that must run on a specific port (e.g., configured in OAuth callbacks) - set `strictPort: true`
215
+
184
216
  ## 📋 Configuration Details
185
217
 
186
218
  ### Default Settings
@@ -321,9 +353,9 @@ Add build scripts to your `package.json`:
321
353
  Then run:
322
354
 
323
355
  ```bash
324
- npm run dev # Start development server
325
- npm run build # Build for production
326
- npm run preview # Preview production build
356
+ pnpm dev # Start development server
357
+ pnpm build # Build for production
358
+ pnpm preview # Preview production build
327
359
  ```
328
360
 
329
361
  ## 📋 Requirements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmlweb/vite-config",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Base Vite configuration for jmlweb projects with TypeScript support, build optimization, and optional React integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",