From 74a190784e7885a04fa002d5caf4cea3ea336c68 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 31 Oct 2023 15:17:17 -0600 Subject: [PATCH] More re-brand, add config --- .env | 3 +++ README.md | 22 +++------------------- next.config.js | 6 +++++- pages/_app.tsx | 2 +- pages/index.tsx | 16 +++++++++++++++- public/manifest.json | 4 ++-- 6 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..a279c91 --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +CERC_TEST_WEBAPP_CONFIG1="this string" +CERC_TEST_WEBAPP_CONFIG2="this different string" +CERC_WEBAPP_DEBUG=0 diff --git a/README.md b/README.md index 22dbf52..33cbcca 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,7 @@ -# Progressive Web App Example +# Test Progressive Web App -This example uses [`next-pwa`](https://github.com/shadowwalker/next-pwa) to create a progressive web app (PWA) powered by [Workbox](https://developers.google.com/web/tools/workbox/). +This example used [`next-pwa`](https://github.com/shadowwalker/next-pwa) to create a progressive web app (PWA) powered by [Workbox](https://developers.google.com/web/tools/workbox/). ## Deploy your own -Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example): - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/progressive-web-app&project-name=progressive-web-app&repository-name=progressive-web-app) - -## How to use - -Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: - -```bash -npx create-next-app --example progressive-web-app progressive-web-app -# or -yarn create next-app --example progressive-web-app progressive-web-app -# or -pnpm create next-app --example progressive-web-app progressive-web-app -``` - -Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). +(Under construction) diff --git a/next.config.js b/next.config.js index 31809c9..bc3bd17 100644 --- a/next.config.js +++ b/next.config.js @@ -4,5 +4,9 @@ const withPWA = require('next-pwa')({ }) module.exports = withPWA({ - // config + env: { + CERC_TEST_WEBAPP_CONFIG1: process.env.CERC_TEST_WEBAPP_CONFIG1, + CERC_TEST_WEBAPP_CONFIG2: process.env.CERC_TEST_WEBAPP_CONFIG2, + CERC_WEBAPP_DEBUG: process.env.CERC_WEBAPP_DEBUG, + }, }) diff --git a/pages/_app.tsx b/pages/_app.tsx index 3601ddf..a9ff536 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -14,7 +14,7 @@ export default function MyApp({ Component, pageProps }: AppProps) { /> - Next.js PWA Example + Laconic Test PWA
+ +

+ CONFIG1 has value: {process.env.CERC_TEST_WEBAPP_CONFIG1} +

+ +

+ CONFIG2 has value: {process.env.CERC_TEST_WEBAPP_CONFIG2} +

+ +

+ WEBAPP_DEBUG has value: {process.env.CERC_WEBAPP_DEBUG} +

+
+