mirror of
https://github.com/fantasticit/think.git
synced 2026-09-01 15:10:55 +08:00
client: add sw
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* eslint-env es6 */
|
||||
const semi = require('@douyinfe/semi-next').default({});
|
||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||
const withOffline = require('next-offline');
|
||||
const { getConfig } = require('@think/config');
|
||||
const config = getConfig();
|
||||
|
||||
@@ -24,6 +24,26 @@ const nextConfig = semi({
|
||||
typescript: {
|
||||
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-sup": "^1.0.0",
|
||||
"next": "12.0.10",
|
||||
"next-offline": "^5.0.5",
|
||||
"prosemirror-markdown": "^1.7.0",
|
||||
"prosemirror-tables": "^1.1.1",
|
||||
"prosemirror-utils": "^0.9.6",
|
||||
|
||||
Generated
+1985
-76
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user