forked from whoisryosuke/r3f-next-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
43 lines (39 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
const plugins = require("next-compose-plugins");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
const withOffline = require("next-offline");
// The NextJS config defined separately
// Gets passed to next-offline
const nextConfig = {
webpack(config, { isServer }) {
// Allow importing of shader files (e.g. `.glsl` -- filenames below)
// @see: https://github.com/glslify/glslify-loader
config.module.rules.push({
test: /\.(glsl|vs|fs|vert|frag|ps)$/,
exclude: /node_modules/,
use: ["raw-loader", "glslify-loader"],
});
return config;
},
// Internationalized Routing
// @see: https://nextjs.org/docs/advanced-features/i18n-routing
i18n: {
locales: ["en-US"],
defaultLocale: "en-US",
},
};
module.exports = plugins(
[
// Setup Offline Support
// This requires the `public` folder with a `manifest.json`
[
withOffline,
{
// Optional offline config
},
],
withBundleAnalyzer,
],
nextConfig
);