-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
51 lines (46 loc) · 1.16 KB
/
Copy pathnext.config.js
File metadata and controls
51 lines (46 loc) · 1.16 KB
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
46
47
48
49
50
51
/** @type {import('next').NextConfig} */
require('dotenv').config();
const path = require('path');
const withPlugins = require('next-compose-plugins');
const withLess = require('next-with-less');
const lessVariables = path.resolve('./src/styles/variables.less');
/** Setup plugins */
const plugins = [
[
withLess,
{
lessLoaderOptions: {
additionalData: (content) => `${content}\n\n@import '${lessVariables}';`,
lessOptions: {
javascriptEnabled: true,
},
},
},
],
];
/** Main Next.js configuration */
const mainConfig = {
// output: 'standalone',
reactStrictMode: false,
staticPageGenerationTimeout: 1000,
swcMinify: true,
images: {
domains: ['cdn.discordapp.com'],
},
experimental: {
outputStandalone: true,
},
webpack: (config) => {
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
};
return config;
},
};
/** Image hosts */
if (process.env.NEXT_PUBLIC_STORAGE_HOST) {
mainConfig.images.domains.push(process.env.NEXT_PUBLIC_STORAGE_HOST);
console.log('Allowed images hostnames', mainConfig.images.domains);
}
module.exports = withPlugins(plugins, mainConfig);