-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
38 lines (36 loc) · 986 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
36
37
38
const withCSS = require('@zeit/next-css')
const withTypescript = require('@zeit/next-typescript')
const { withPlugins } = require('next-compose-plugins')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const { PHASE_PRODUCTION_BUILD } = require('next/constants')
const reponame = 'cv'
module.exports = withPlugins(
[
withTypescript,
[
withCSS,
{
cssModules: true,
cssLoaderOptions: {
localIdentName: '[local]--[hash:base64:5]'
},
[PHASE_PRODUCTION_BUILD]: {
cssLoaderOptions: {
importLoaders: 1,
localIdentName: '[hash:base64:4]'
}
}
}
]
],
{
assetPrefix: process.env.NODE_ENV === 'production' ? `/${reponame}` : '',
webpack(config, options) {
// Do not run type checking twice:
if (options.isServer) {
config.plugins.push(new ForkTsCheckerWebpackPlugin())
}
return config
}
}
)