-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
44 lines (39 loc) · 1.25 KB
/
next.config.js
File metadata and controls
44 lines (39 loc) · 1.25 KB
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
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const { withPlaiceholder } = require('@plaiceholder/next');
const withTM = require('next-transpile-modules')([
'@fullcalendar/common',
'@fullcalendar/react',
'@fullcalendar/daygrid',
'@fullcalendar/interaction',
'@fullcalendar/timegrid'
]);
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
});
module.exports = withBundleAnalyzer(withPlaiceholder(withTM({
images: {
domains: ['res.cloudinary.com', 'api.mapbox.com']
},
webpack(config, { dev, isServer }) {
// For getting all Typescript errors
if (dev && isServer) {
config.plugins.push(new ForkTsCheckerWebpackPlugin());
}
// To fix "module not found" errors
if (!isServer) {
config.resolve.fallback = {
fs: false
}
}
// Copy our email templates
if (!dev) {
config.plugins.push(
new CopyPlugin({
patterns: [{ from: 'email-templates', to: 'email-templates' }]
})
);
}
return config;
}
})));