Repository navigation
Expand file tree
/
Copy pathnext.config.js
More file actions
64 lines (62 loc) · 1.62 KB
/
Copy pathnext.config.js
File metadata and controls
64 lines (62 loc) · 1.62 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
hostname: 'images.unsplash.com',
protocol: 'https',
},
{
hostname: 'unsplash.com',
protocol: 'https',
},
{
hostname: 'images.pexels.com',
protocol: 'https',
},
{
hostname: 'plus.unsplash.com',
protocol: 'https',
pathname: "**"
},
]
},
webpack: (config) => {
const TerserPlugin = require('terser-webpack-plugin');
return {
...config,
optimization: {
...config.optimization,
// Using TerserPlugin created by Next.js breaks the editor, so we create a custom one.
// About the error: https://github.com/TypeCellOS/BlockNote/issues/292
// TerserPlugin Option reference: https://github.com/vercel/next.js/blob/5f9d2c55ca3ca3bd6a01cf60ced69d3dd2c64bf4/packages/next/src/build/webpack-config.ts#L1151
minimizer: [
new TerserPlugin({
terserOptions: {
parse: {
ecma: 8,
},
compress: {
ecma: 5,
warnings: false,
comparisons: false,
inline: 2,
},
output: {
ecma: 5,
safari10: true,
comments: false,
ascii_only: true,
},
mangle: {
safari10: true,
},
},
}),
config.optimization.minimizer[1],
],
},
};
},
}
module.exports = nextConfig