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) { /> -
+ 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} +
+