forked from AmTote/calendar-appointments
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
50 lines (43 loc) Β· 1.03 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
module.exports = {
async redirects() {
return [
{
source: "/",
destination: "/calendar",
permanent: true,
},
]
},
pageExtensions: ["js", "jsx", "ts", "tsx"],
webpack5: true,
webpack: (config, { dev, isServer, webpack }) => {
config.module.rules.push({
test: /\.(png|jpe?g|gif|mp4)$/i,
use: [
{
loader: "file-loader",
options: {
publicPath: "/_next",
name: "static/media/[name].[hash].[ext]",
},
},
],
})
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
})
config.module.rules.push({
test: /\.tsx?$/,
exclude: /node_modules/,
loader: "esbuild-loader",
options: { loader: "tsx", target: "esnext" },
})
config.plugins.push(
new webpack.ProvidePlugin({
React: "react",
})
) // Support JSX Transform per https://dev.to/rsa/speed-up-next-js-build-with-typescript-and-tailwind-css-418d
return config
},
}