-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
62 lines (60 loc) · 2 KB
/
next.config.mjs
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
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: function (config, { webpack }) {
// Next.js WebPack Bundler does not know how to handle `.mjs` files on `node_modules`
// This is not an issue when using TurboPack as it uses SWC and it is ESM-only
// Once Next.js uses Turbopack for their build process we can remove this
config.module.rules.push({
test: /\.m?js$/,
type: 'javascript/auto',
resolve: { fullySpecified: false },
});
return config;
},
experimental: {
// Some of our static pages from `getStaticProps` have a lot of data
// since we pass the fully-compiled MDX page from `MDXRemote` through
// a page's static props.
largePageDataBytes: 128 * 100000,
// A list of packages that Next.js should automatically evaluate and optimise the imports for.
// @see https://vercel.com/blog/how-we-optimized-package-imports-in-next-js
optimizePackageImports: [
'tailwindcss',
'shiki',
],
// Removes the warning regarding the WebPack Build Worker
webpackBuildWorker: true,
},
// To import ESM-only packages with next dev --turbo. Source: https://github.com/vercel/next.js/issues/63318#issuecomment-2079677098
transpilePackages: ['shiki'],
async redirects() {
return [
{
source: '/vue',
destination: '/soon',
permanent: true
},
{
source: '/nuxt',
destination: '/soon',
permanent: true
},
{
source: '/react',
destination: '/react/hooks/stateManagement',
permanent: true
},
{
source: '/next',
destination: '/soon',
permanent: true
},
{
source: '/blog',
destination: '/blog/all',
permanent: true
},
]
}
};
export default nextConfig;