-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
45 lines (40 loc) · 1.04 KB
/
next.config.js
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
45
/** @type {import('next').NextConfig} */
const plugins = require("next-compose-plugins");
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === "development",
});
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
// The NextJS config defined separately
// Gets passed to next-offline
const nextConfig = withPWA({
images: {
remotePatterns: [
{
protocol: "https",
hostname: "cdn.sanity.io",
},
],
},
webpack(config, { isServer }) {
config.module.rules.push({
test: /\.(glb|gltf)$/,
use: [
{
loader: "file-loader",
options: {
outputPath: "static/assets/models/",
publicPath: "/_next/static/assets/models/",
esModule: false, // Important for gltf-webpack-loader compatibility
},
},
],
});
return config;
},
});
module.exports = plugins([withBundleAnalyzer], nextConfig);