-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
31 lines (24 loc) · 1.02 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
const withTypescript = require('@zeit/next-typescript');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const nextConfig = withTypescript({
// override webpack configurations below
webpack(config, options) {
// do not run type checking twice:
if (options.isServer) {
// forks type checking to separate thread from compilation
config.plugins.push(new ForkTsCheckerWebpackPlugin());
}
// inform resolver to handle TS and JS file formats
config.resolve.extensions = ['.ts', '.tsx', '.js', '.json'];
// copies tsconfig.json aliases into webpack's aliases
config.resolve.plugins = [
new TsconfigPathsPlugin({
configFile: './tsconfig.json',
logLevel: 'info',
})];
return config;
}
});
// nextConfig.useFileSystemPublicRoutes = false;
module.exports = nextConfig;