boennemann / next-safe-middleware

Strict CSP (Content-Security-Policy) for Next 12 hybrid apps https://web.dev/strict-csp/

Home Page:https://next-safe-middleware.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The package has been developed from a private monorepo so far, this is a first step to make it public with a proper development and release process.

There is an e2e test app that uses package bundles from source:

https://next-safe-middleware.vercel.app/

Getting started

Jump into development:

yarn dev

It will rebuild packages on changes and start the dev server of the e2e test app.

To evaluate things around strict CSPs you need to serve a production build of the e2e test app:

yarn start

or deploy the e2e test app to Vercel:

Deploy with Vercel

In your Vercel project settings:

Set apps/e2e as "Root Directory" and enable "Include source files outside of the Root Directory in the Build Step."

In "Build & Development Settings":

Set "Framework Preset" to Next.js

and override the following commands:

Build Command:

cd ../.. && yarn build:e2e:vercel

Install Command:

yarn install --immutable --immutable-cache

About

Strict CSP (Content-Security-Policy) for Next 12 hybrid apps https://web.dev/strict-csp/

https://next-safe-middleware.vercel.app


Languages

Language:TypeScript 91.3%Language:JavaScript 8.6%Language:CSS 0.1%