mirror of https://github.com/fantasticit/think.git
client: add sw
This commit is contained in:
parent
e8bdb8fb7c
commit
bed61365cd
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-env es6 */
|
|
||||||
const semi = require('@douyinfe/semi-next').default({});
|
const semi = require('@douyinfe/semi-next').default({});
|
||||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||||
|
const withOffline = require('next-offline');
|
||||||
const { getConfig } = require('@think/config');
|
const { getConfig } = require('@think/config');
|
||||||
const config = getConfig();
|
const config = getConfig();
|
||||||
|
|
||||||
|
@ -24,6 +24,26 @@ const nextConfig = semi({
|
||||||
typescript: {
|
typescript: {
|
||||||
ignoreBuildErrors: true,
|
ignoreBuildErrors: true,
|
||||||
},
|
},
|
||||||
|
workboxOpts: {
|
||||||
|
runtimeCaching: [
|
||||||
|
{
|
||||||
|
urlPattern: /.(png|jpg|jpeg|svg|webp)$/,
|
||||||
|
handler: 'CacheFirst',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
urlPattern: /api/,
|
||||||
|
handler: 'NetworkFirst',
|
||||||
|
options: {
|
||||||
|
cacheableResponse: {
|
||||||
|
statuses: [0, 200],
|
||||||
|
headers: {
|
||||||
|
'x-sw': 'true',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = nextConfig;
|
module.exports = withOffline(nextConfig);
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
"markdown-it-sub": "^1.0.0",
|
"markdown-it-sub": "^1.0.0",
|
||||||
"markdown-it-sup": "^1.0.0",
|
"markdown-it-sup": "^1.0.0",
|
||||||
"next": "12.0.10",
|
"next": "12.0.10",
|
||||||
|
"next-offline": "^5.0.5",
|
||||||
"prosemirror-markdown": "^1.7.0",
|
"prosemirror-markdown": "^1.7.0",
|
||||||
"prosemirror-tables": "^1.1.1",
|
"prosemirror-tables": "^1.1.1",
|
||||||
"prosemirror-utils": "^0.9.6",
|
"prosemirror-utils": "^0.9.6",
|
||||||
|
|
2061
pnpm-lock.yaml
2061
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue