Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable New CSS Support by Default #9927

Merged
merged 13 commits into from Jan 9, 2020
8 changes: 6 additions & 2 deletions packages/next/next-server/server/config.ts
Expand Up @@ -42,7 +42,7 @@ const defaultConfig: { [key: string]: any } = {
(Number(process.env.CIRCLE_NODE_TOTAL) ||
(os.cpus() || { length: 1 }).length) - 1
),
css: false,
css: true,
documentMiddleware: false,
granularChunks: true,
modern: false,
Expand Down Expand Up @@ -109,7 +109,11 @@ function assignDefaults(userConfig: { [key: string]: any }) {
if (result.experimental) {
if (result.experimental.css) {
// The new CSS support requires granular chunks be enabled.
result.experimental.granularChunks = true
if (result.experimental.granularChunks !== true) {
throw new Error(
`The new CSS support requires granular chunks be enabled.`
)
}
}

if (typeof result.experimental.basePath !== 'string') {
Expand Down
1 change: 0 additions & 1 deletion test/integration/chunking-minimal/next.config.js
@@ -1,6 +1,5 @@
module.exports = {
experimental: {
modern: true,
granularChunks: true,
},
}
3 changes: 0 additions & 3 deletions test/integration/chunking/next.config.js
@@ -1,9 +1,6 @@
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
module.exports = {
experimental: {
granularChunks: true,
},
webpack(config) {
config.plugins = config.plugins || []
config.plugins.push(
Expand Down
5 changes: 0 additions & 5 deletions test/integration/css-fixtures/next.config.js
Expand Up @@ -3,11 +3,6 @@ module.exports = {
// Make sure entries are not getting disposed.
maxInactiveAge: 1000 * 60 * 60,
},
experimental: {
css: true,
// Intentionally set false to ensure we force to true.
granularChunks: false,
},
webpack(cfg) {
cfg.devtool = 'source-map'
return cfg
Expand Down