rsnext/test/integration/production-config/next.config.js
Joe Haddad 32cb5e105a Disable CSS Support When Manually Configured (#9735)
* Disable CSS Support When Manually Configured

* upgrade TS

* adjust yarn lock

* Remove another version of TypeScript

* Remove possibly leftover loader

* Revert "Remove possibly leftover loader"

This reverts commit 7ce2d1a8854f3d7a833867f8ac3be7923a6cb1d8.

* Update to use no-op loader
2019-12-13 14:23:28 -06:00

49 lines
1.3 KiB
JavaScript

const withCSS = require('@zeit/next-css')
const withSass = require('@zeit/next-sass')
const path = require('path')
module.exports = withCSS(
withSass({
env: {
...(process.env.ENABLE_ENV_FAIL_UNDERSCORE
? {
__NEXT_MY_VAR: 'test',
}
: {}),
...(process.env.ENABLE_ENV_FAIL_NODE
? {
NODE_ENV: 'abc',
}
: {}),
...(process.env.ENABLE_ENV_WITH_UNDERSCORES
? {
SOME__ENV__VAR: '123',
}
: {}),
},
onDemandEntries: {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60,
},
experimental: { css: true },
webpack(config) {
// 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
},
async generateBuildId() {
return 'custom-buildid'
},
})
)