@ressjs/vite-router 0.5.0 → 0.5.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.
- package/README.md +1 -1
- package/dist/helpers/middlewares.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -367,9 +367,11 @@ async function loadMiddlewareModule(middlewareInfo, vite) {
|
|
|
367
367
|
}
|
|
368
368
|
else {
|
|
369
369
|
// En producción, usar archivos compilados
|
|
370
|
+
// Vite transforms [param] to _param_ in compiled filenames
|
|
370
371
|
const compiledPath = middlewareInfo.file
|
|
371
372
|
.replace(/^app\/pages\//, 'dist/server/')
|
|
372
|
-
.replace(/\.ts$/, '.js')
|
|
373
|
+
.replace(/\.ts$/, '.js')
|
|
374
|
+
.replace(/\[(\w+)\]/g, '_$1_'); // [photocardId] -> _photocardId_
|
|
373
375
|
const moduleUrl = node_path_1.default.resolve(compiledPath);
|
|
374
376
|
moduleToLoad = await Promise.resolve(`${moduleUrl}`).then(s => __importStar(require(s)));
|
|
375
377
|
}
|
package/package.json
CHANGED