vite-plugin-milpa 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -157,8 +157,8 @@ function pwaPlugins(options) {
157
157
  // El shell HTML lo sirve el backend (no está en dist/): precachearlo da
158
158
  // cold-start offline y el fallback de documentos del sw.js.
159
159
  ...(pwa.shell ? {additionalPrecacheEntries: [{url: pwa.shell, revision: `${Date.now()}`}]} : {}),
160
- // GOTCHA (docs/prerelease/26): los entries salen RELATIVOS y resuelven
161
- // contra la URL del SW → 404 bajo subpath. Se prefijan con la base real.
160
+ // GOTCHA: los entries salen RELATIVOS y resuelven contra la URL del SW
161
+ // → 404 bajo subpath. Se prefijan con la base real.
162
162
  manifestTransforms: [
163
163
  (entries) => ({
164
164
  manifest: entries.map((entry) => (
@@ -169,5 +169,9 @@ function pwaPlugins(options) {
169
169
  });
170
170
  // El SW solo se genera en BUILD: en dev serviría assets stale y pelearía
171
171
  // con HMR. `apply: 'build'` es el switch idiomático de Vite para esto.
172
- return (Array.isArray(raw) ? raw : [raw]).map((plugin) => ({apply: 'build', ...plugin}));
172
+ // El override va DESPUÉS del spread: el sub-plugin dev de serwist trae su
173
+ // propio `apply: 'serve'` y con el orden invertido pisaría el nuestro —
174
+ // su middleware quedaba vivo en dev SIN el plugin principal que inicializa
175
+ // `ctx.options`, y tronaba en cada request del dev server.
176
+ return (Array.isArray(raw) ? raw : [raw]).map((plugin) => ({...plugin, apply: 'build'}));
173
177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-milpa",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "El toolkit frontend del framework milpa (FastAPI + Jinja), estilo laravel-vite-plugin: hot-file para HMR, manifest para el helper vite() de Jinja, multi-app (surcos/), PWA opcional con Serwist, ASSET_URL para deploy bajo sub-ruta/CDN — y file-based routing para react-router 7 vía `vite-plugin-milpa/router`.",
5
5
  "type": "module",
6
6
  "main": "index.js",