rsnext/test/integration/config/next.config.js
Joe Haddad b3170d2648
Format missed files (#7464)
* Format missed files

* Remove unnecessary rule

* Fix type error
2019-05-29 18:19:32 -07:00

44 lines
1.2 KiB
JavaScript

const withCSS = require('@zeit/next-css')
const withSass = require('@zeit/next-sass')
const path = require('path')
module.exports = withCSS(
withSass({
onDemandEntries: {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60
},
poweredByHeader: false,
cssModules: true,
serverRuntimeConfig: {
mySecret: 'secret'
},
publicRuntimeConfig: {
staticFolder: '/static'
},
env: {
customVar: 'hello'
},
webpack (config, { buildId, webpack }) {
// 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)
}
config.plugins.push(
new webpack.DefinePlugin({
'process.env.CONFIG_BUILD_ID': JSON.stringify(buildId)
})
)
return config
}
})
)