forked from Azaeres/etherion-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
40 lines (34 loc) · 1.08 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
const path = require('path')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const withPWA = require('@ducanh2912/next-pwa').default({
dest: 'public',
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
skipWaiting: true,
})
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: false,
output: 'export',
distDir: '_static',
eslint: {
dirs: ['pages', 'components', 'lib', 'layouts', 'scripts', 'app'], // Only run ESLint on these directories during production builds (next build)
},
webpack(config, { dev, isServer }) {
if (dev && !isServer) {
const originalEntry = config.entry
config.entry = async () => {
const wdrPath = path.resolve(__dirname, './src/wdyr.ts')
const entries = await originalEntry()
if (entries['main.js'] && !entries['main.js'].includes(wdrPath)) {
entries['main.js'].push(wdrPath)
}
return entries
}
}
return config
},
}
module.exports = withBundleAnalyzer(withPWA(nextConfig))