-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
32 lines (28 loc) · 909 Bytes
/
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
/**
* @type {import('next').NextConfig}
*/
const path = require('path');
const isProd = process.env.NODE_ENV === 'production';
const internalHost = process.env.TAURI_DEV_HOST || 'localhost';
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const nextConfig = {
output: 'export',
images: {
unoptimized: true,
},
assetPrefix: isProd ? undefined : `http://${internalHost}:3000`,
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Custom SVG loader configuration
config.module.rules.push({
test: /\.svg$/,
include: [path.resolve(__dirname, './src/assets/tags'), path.resolve(__dirname, './src/assets/ui')],
use: [{
loader: path.resolve(__dirname, './config/svg-path-reader.js'),
}],
});
return config;
},
}
module.exports = withBundleAnalyzer(nextConfig);