Skip to content

Commit

Permalink
Merge branch 'develop' into feature/app-router-preview-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Jul 11, 2024
2 parents 98bae20 + 96ea386 commit 163fbcf
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
9 changes: 0 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
"import": "./dist/mjs/react/index.js",
"types": "./dist/mjs/react/index.d.ts"
},
"./rsc": {
"import": "./dist/mjs/rsc/index.js",
"require": "./dist/cjs/rsc/index.js",
"types": "./dist/mjs/rsc/index.d.ts"
},
"./test": "./test/server.ts"
},
"files": [
Expand Down
1 change: 1 addition & 0 deletions packages/core/rsc.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dist/mjs/rsc';
2 changes: 2 additions & 0 deletions packages/core/rsc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line import/extensions
module.exports = require('./dist/cjs/rsc');
2 changes: 1 addition & 1 deletion projects/wp-nextjs-app/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@

.form-container button:hover {
background-color: #45a049;
}
}
20 changes: 20 additions & 0 deletions projects/wp-nextjs-app/src/app/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { AppMiddleware } from '@headstartwp/next/middlewares';
import { NextRequest } from 'next/server';

export const config = {
matcher: [
/*
* Match all paths except for:
* 1. /api routes
* 2. /_next (Next.js internals)
* 3. /fonts (inside /public)
* 4. all root files inside /public (e.g. /favicon.ico)
*/
'/((?!api|cache-healthcheck|_next|fonts[\\w-]+\\.\\w+).*)',
],
};

export async function middleware(req: NextRequest) {
// @ts-expect-error
return AppMiddleware(req, { appRouter: true });
}

0 comments on commit 163fbcf

Please sign in to comment.