-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
33 lines (32 loc) · 1.01 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
const path = require('path')
const withPlugins = require('next-compose-plugins')
const withOffline = require('next-offline')
const withSass = require('@zeit/next-sass')
const withCSS = require('@zeit/next-css')
const withBundleAnalyzer = require('@zeit/next-bundle-analyzer')
const withImages = require('next-images')
const plugins = [withOffline, withBundleAnalyzer, withImages, withCSS, withSass]
module.exports = withPlugins(plugins, {
exportPathMap: function() {
return {
'/': { page: '/' },
'/fa': { page: '/fa' }
}
},
analyzeServer: ['server', 'both'].includes(process.env.BUNDLE_ANALYZE),
analyzeBrowser: ['browser', 'both'].includes(process.env.BUNDLE_ANALYZE),
bundleAnalyzerConfig: {
server: {
analyzerMode: 'static',
reportFilename: '../bundles/server.html'
},
browser: {
analyzerMode: 'static',
reportFilename: '../bundles/client.html'
}
},
webpack(config) {
config.resolve.alias['@'] = path.join(__dirname, 'src')
return config
}
})