You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
980 B
43 lines
980 B
4 years ago
|
const path = require('path')
|
||
|
const withPlugins = require('next-compose-plugins')
|
||
|
const withSourceMaps = require('@zeit/next-source-maps')
|
||
|
const optimizedImages = require('next-optimized-images')
|
||
|
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
||
|
enabled: process.env.ANALYZE === 'true',
|
||
|
})
|
||
|
// const withCSS = require('@zeit/next-css')
|
||
|
|
||
|
const basePath = process.env.NODE_ENV === 'development' ? '' : ''
|
||
|
|
||
|
module.exports = withPlugins(
|
||
|
[
|
||
|
[withBundleAnalyzer({})],
|
||
|
[
|
||
|
withSourceMaps({
|
||
|
webpack(config) {
|
||
|
return config
|
||
|
},
|
||
|
}),
|
||
|
],
|
||
|
[
|
||
|
optimizedImages,
|
||
|
{
|
||
|
responsive: {
|
||
|
adapter: require('responsive-loader/sharp'),
|
||
|
publicPath: path.join(basePath, '_next/static/images/'),
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
// [withCSS({ cssModules: true })],
|
||
|
],
|
||
|
{
|
||
|
publicRuntimeConfig: {
|
||
|
basePath,
|
||
|
},
|
||
|
serverRuntimeConfig: {
|
||
|
PROJECT_ROOT: __dirname,
|
||
|
},
|
||
|
basePath,
|
||
|
},
|
||
|
)
|