-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
29 lines (28 loc) · 795 Bytes
/
next.config.js
File metadata and controls
29 lines (28 loc) · 795 Bytes
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
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const prod = process.env.NODE_ENV === 'production';
const DEPLOY_PREFIX = prod ? '/mobx-react-eyepetizer' : '';
const { ANALYZE } = process.env;
module.exports = {
exportPathMap: function() {
return {
'/': { page: '/' },
'/detail': { page: '/detail' }
};
},
// for gh-pages
assetPrefix: DEPLOY_PREFIX,
webpack: function(config) {
if (ANALYZE) {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'server',
analyzerPort: 8888,
openAnalyzer: true
})
);
}
// feel bad https://github.com/zeit/next.js/issues/2759
config.output.publicPath = `${DEPLOY_PREFIX}${config.output.publicPath}`;
return config;
}
};