-
-
Notifications
You must be signed in to change notification settings - Fork 259
/
Copy pathnext.config.js
43 lines (37 loc) · 1.09 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
const isViz = process.env.ANALYZE === 'true'
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: isViz,
})
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { isServer }) => {
// aliases for resolving packages in the project
config.resolve.alias = {
...config.resolve.alias,
'@vue/compiler-sfc': '@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js',
lightningcss: 'lightningcss-wasm',
}
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
perf_hooks: false,
fs: false,
module: require.resolve('./module.shim.ts'),
os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
util: require.resolve('util'),
process: require.resolve('process/browser'),
}
}
config.module.rules.push({
resourceQuery: /raw/,
loader: 'raw-loader',
})
return config
},
reactStrictMode: true,
typescript: {
ignoreBuildErrors: isViz,
},
}
module.exports = withBundleAnalyzer(nextConfig)