forked from mx-space/kami
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
47 lines (41 loc) · 1.1 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
process.title = 'Kami (NextJS)'
const WindiCSSWebpackPlugin = require('windicss-webpack-plugin')
const path = require('path')
const env = require('dotenv').config().parsed || {}
const isProd = process.env.NODE_ENV === 'production'
/** @type {import('next').NextConfig} */
const configs = {
swcMinify: true,
experimental: {
scrollRestoration: true,
legacyBrowsers: false,
newNextLinkBehavior: true,
},
webpack: (config, options) => {
config.resolve.alias = {
...config.resolve.alias,
// your aliases
'@mx-space/kami-design': path.resolve(
__dirname,
'./packages/kami-design',
),
}
config.plugins.push(new WindiCSSWebpackPlugin())
return config
},
output: 'standalone',
assetPrefix: isProd ? env.ASSETPREFIX || undefined : undefined,
eslint: {
ignoreDuringBuilds: true,
},
async rewrites() {
return {
fallback: [
{ source: '/:page*/:slug*', destination: '/posts/:page*/:slug*' },
],
}
},
}
module.exports = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})(configs)