-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
35 lines (33 loc) · 1000 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
33
34
35
/* eslint-disable @typescript-eslint/no-var-requires */
const withPWA = require('next-pwa');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const withCSS = require('@zeit/next-css');
// Use the hidden-source-map option when you don't want the source maps to be
// publicly available on the servers, only to the error reporting
const withSourceMaps = require('@zeit/next-source-maps')();
module.exports = withCSS(withPWA(withBundleAnalyzer(withSourceMaps({
poweredByHeader: false,
cssModules: true,
target: 'serverless',
cssLoaderOptions: {
// typings-for-css-modules-loader config here
namedExport: true,
},
tsCssModules: true,
pwa: {
dest: 'public',
disable: process.env.NODE_ENV !== 'production',
},
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/,
issuer: {
test: /\.(js|ts)x?$/,
},
use: ['@svgr/webpack'],
});
return config;
},
}))));