-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
63 lines (54 loc) · 1.84 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const Dotenv = require('dotenv-webpack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const path = require('path');
if (typeof require !== 'undefined') {
require.extensions['.css'] = (file) => {};
}
module.exports = {
webpack: (config, { isServer }) => {
config.plugins = config.plugins || [];
config.plugins = [
...config.plugins,
// Read the .env file
new Dotenv({
path: path.join(__dirname, '.env'),
systemvars: true,
}),
];
config.optimization.minimizer = [];
config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({}));
config.module.rules.push({
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000
}
}
});
if (isServer) config.plugins.push(new ForkTsCheckerWebpackPlugin());
config.resolve.modules.unshift(__dirname);
return config;
},
exportPathMap: async function(
defaultPathMap,
{ dev, dir, outDir, distDir, buildId }
) {
return {
'/': { page: '/' },
'/auth/login': { page: '/auth/login' },
'/auth/signup': { page: '/auth/signup' },
'/auth/reset-password': { page: '/auth/reset-password' },
'/auth/unauthorized': { page: '/auth/unauthorized' },
'/app/dashboard': { page: '/app/dashboard' },
'/app/active-session': { page: '/app/active-session' },
'/app/help': { page: '/app/help' },
'/app/mentors': { page: '/app/mentors' },
'/app/profile': { page: '/app/profile' },
'/app/notifications': { page: '/app/notifications' },
'/admin/review-skills': { page: '/admin/review-skills' },
'/admin/manage-admin': { page: '/admin/manage-admin' },
}
},
};