2018-09-11 20:03:20 +02:00
|
|
|
const withCSS = require('@zeit/next-css')
|
|
|
|
const withSass = require('@zeit/next-sass')
|
|
|
|
const path = require('path')
|
|
|
|
module.exports = withCSS(withSass({
|
2019-02-15 17:49:40 +01:00
|
|
|
env: {
|
|
|
|
...(process.env.ENABLE_ENV_FAIL_UNDERSCORE ? {
|
|
|
|
'__NEXT_MY_VAR': 'test'
|
|
|
|
} : {}),
|
|
|
|
...(process.env.ENABLE_ENV_FAIL_NODE ? {
|
|
|
|
'NODE_ENV': 'abc'
|
|
|
|
} : {})
|
|
|
|
},
|
2018-09-11 20:03:20 +02:00
|
|
|
onDemandEntries: {
|
|
|
|
// Make sure entries are not getting disposed.
|
|
|
|
maxInactiveAge: 1000 * 60 * 60
|
|
|
|
},
|
2019-02-15 17:49:40 +01:00
|
|
|
webpack (config) {
|
2018-09-11 20:03:20 +02:00
|
|
|
// When next-css is `npm link`ed we have to solve loaders from the project root
|
|
|
|
const nextLocation = path.join(require.resolve('next/package.json'), '../')
|
|
|
|
const nextCssNodeModulesLocation = path.join(
|
|
|
|
require.resolve('@zeit/next-css'),
|
|
|
|
'../../../node_modules'
|
|
|
|
)
|
|
|
|
|
|
|
|
if (nextCssNodeModulesLocation.indexOf(nextLocation) === -1) {
|
|
|
|
config.resolveLoader.modules.push(nextCssNodeModulesLocation)
|
|
|
|
}
|
|
|
|
|
|
|
|
return config
|
2018-12-04 16:42:25 +01:00
|
|
|
},
|
|
|
|
async generateBuildId () {
|
|
|
|
return 'custom-buildid'
|
2018-09-11 20:03:20 +02:00
|
|
|
}
|
|
|
|
}))
|