mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix: disable parallel build when extractCSS is enabled
This commit is contained in:
parent
bcd672f931
commit
aad46ed674
@ -281,6 +281,12 @@ export function getNuxtConfig(_options) {
|
||||
consola.warn('vendor has been deprecated due to webpack4 optimization')
|
||||
}
|
||||
|
||||
// Disable CSS extraction due to incompatibility with thread-loader
|
||||
if (options.build && options.build.extractCSS && options.build.parallel) {
|
||||
options.build.parallel = false
|
||||
consola.warn('extractCSS cannot work with parallel build due to limited work pool in thread-loader')
|
||||
}
|
||||
|
||||
// build.extractCSS.allChunks has no effect
|
||||
if (typeof options.build.extractCSS.allChunks !== 'undefined') {
|
||||
consola.warn('build.extractCSS.allChunks has no effect from v2.0.0. Please use build.optimization.splitChunks settings instead.')
|
||||
|
@ -105,6 +105,12 @@ describe('config: options', () => {
|
||||
expect(fallback).toEqual('404.html')
|
||||
})
|
||||
|
||||
test('should disable parallel if extractCSS is enabled', () => {
|
||||
const { build: { parallel } } = getNuxtConfig({ build: { extractCSS: true, parallel: true } })
|
||||
expect(parallel).toEqual(false)
|
||||
expect(consola.warn).toHaveBeenCalledWith('extractCSS cannot work with parallel build due to limited work pool in thread-loader')
|
||||
})
|
||||
|
||||
describe('config: router dir', () => {
|
||||
test('should transform middleware to array', () => {
|
||||
const { router: { middleware } } = getNuxtConfig({ router: { middleware: 'midd' } })
|
||||
|
Loading…
Reference in New Issue
Block a user