@fastify/react 1.1.3 → 1.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/package.json +1 -1
- package/routing.js +2 -2
package/package.json
CHANGED
package/routing.js
CHANGED
|
@@ -105,7 +105,7 @@ export async function createRoute({ client, errorHandler, route }, scope, config
|
|
|
105
105
|
handler = (_, reply) => reply.html()
|
|
106
106
|
} else {
|
|
107
107
|
const { id } = route
|
|
108
|
-
const htmlPath = id.replace(/
|
|
108
|
+
const htmlPath = id.replace('pages/', 'html/').replace(/\.(j|t)sx$/, '.html')
|
|
109
109
|
let distDir = config.vite.build.outDir
|
|
110
110
|
if (!isAbsolute(config.vite.build.outDir)) {
|
|
111
111
|
distDir = join(config.vite.root, distDir)
|
|
@@ -116,7 +116,7 @@ export async function createRoute({ client, errorHandler, route }, scope, config
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
// Replace wildcard routes with Fastify compatible syntax
|
|
119
|
-
const routePath = route.path.replace(
|
|
119
|
+
const routePath = route.path.replace(/:\w[\w-]*\+/, '*')
|
|
120
120
|
|
|
121
121
|
unshiftHook(route, 'onRequest', onRequest)
|
|
122
122
|
unshiftHook(route, 'preHandler', preHandler)
|