-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
51 lines (49 loc) · 1.21 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
const withBuilderDevTools = require("@builder.io/dev-tools/next")()
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
/** @type {import('next').NextConfig} */
module.exports = withBundleAnalyzer(
withBuilderDevTools({
reactStrictMode: true,
transpilePackages: ["ui"],
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
port: "",
pathname: "**",
},
],
},
rewrites: () => {
return [
{
source: "/fb/:path*",
destination: "https://connect.facebook.net/:path*",
},
]
},
experimental: {
nextScriptWorkers: true,
esmExternals: "loose",
},
webpack(config, { isServer }) {
// https://github.com/wojtekmaj/react-pdf/issues/799
// https://github.com/mozilla/pdf.js/issues/13373
if (isServer) {
config.resolve.alias.canvas = false
config.resolve.alias.encoding = false
}
config.module.rules.push({
test: /\.m?js$/,
type: "javascript/auto",
resolve: {
fullySpecified: false,
},
})
return config
},
}),
)