-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.mjs
45 lines (43 loc) · 1.04 KB
/
next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import withSerwistInit from "@serwist/next";
const revision = "v1.0.0"
import { codeInspectorPlugin } from 'code-inspector-plugin'
const withSerwist = withSerwistInit({
cacheOnNavigation: true,
swSrc: "app/sw.ts",
swDest: "public/sw.js",
additionalPrecacheEntries: [{ url: "/~offline", revision }],
});
const basePath = process.env.BASE_URL || '';
const OSSPaths = process.env.OSS_URLs || '';
const remotePatterns = OSSPaths.split(',').map((hostname) => {
return {
protocol:"https",
hostname,
port:"",
pathname: '**'
}
});
/** @type {import('next').NextConfig} */
const nextConfig ={
output: "standalone",
reactStrictMode:false,
images: {
remotePatterns
},
async rewrites() {
return {
fallback: [
{
source: '/api/:path*',
destination: `${basePath}/api/:path*`,
},
],
}
},
webpack: (config) => {
config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }));
return config;
},
}
// export default withSerwist(nextConfig);
export default nextConfig