feat: add pwa support by next-pwa
This commit is contained in:
@@ -70,4 +70,9 @@ const withDebugLocal = require('next-debug-local')(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
module.exports = withDebugLocal(nextConfig);
|
const withPWA = require('next-pwa')({
|
||||||
|
dest: 'public',
|
||||||
|
disable: process.env.NODE_ENV !== 'production',
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = withDebugLocal(withPWA(nextConfig));
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
|
"next-pwa": "^5.6.0",
|
||||||
"typescript": "4.8.3"
|
"typescript": "4.8.3"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|||||||
BIN
packages/app/public/apple-touch-icon.png
Normal file
BIN
packages/app/public/apple-touch-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
BIN
packages/app/public/chrome-192x192.png
Normal file
BIN
packages/app/public/chrome-192x192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
17
packages/app/public/manifest.json
Normal file
17
packages/app/public/manifest.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "AFFiNE",
|
||||||
|
"short_name": "AFFiNE",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/chrome-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "any"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"theme_color": "#ffffff",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"start_url": "/",
|
||||||
|
"display": "standalone",
|
||||||
|
"orientation": "portrait"
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ import { useRouter } from 'next/router';
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useAppState } from '@/providers/app-state-provider';
|
import { useAppState } from '@/providers/app-state-provider';
|
||||||
import { PageLoading } from '@/components/loading';
|
import { PageLoading } from '@/components/loading';
|
||||||
|
import Head from 'next/head';
|
||||||
|
|
||||||
const ThemeProvider = dynamic(() => import('@/providers/themeProvider'), {
|
const ThemeProvider = dynamic(() => import('@/providers/themeProvider'), {
|
||||||
ssr: false,
|
ssr: false,
|
||||||
@@ -38,6 +39,15 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Head>
|
||||||
|
<meta name="theme-color" content="#fafafa" />
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
|
<link
|
||||||
|
rel="apple-touch-icon"
|
||||||
|
sizes="180x180"
|
||||||
|
href="/icons/apple-touch-icon.png"
|
||||||
|
/>
|
||||||
|
</Head>
|
||||||
<Logger />
|
<Logger />
|
||||||
<ProviderComposer
|
<ProviderComposer
|
||||||
contexts={[
|
contexts={[
|
||||||
|
|||||||
2793
pnpm-lock.yaml
generated
2793
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user