diff --git a/src/compiler/config/test/validate-config.spec.ts b/src/compiler/config/test/validate-config.spec.ts index c99446e3cc2..39729ce9a62 100644 --- a/src/compiler/config/test/validate-config.spec.ts +++ b/src/compiler/config/test/validate-config.spec.ts @@ -309,4 +309,15 @@ describe('validation', () => { expect(config.extras.initializeNextTick).toBe(false); expect(config.extras.tagNameTransform).toBe(false); }); + + it('should set taskQueue "async" by default', () => { + const { config } = validateConfig(userConfig); + expect(config.taskQueue).toBe('async'); + }); + + it('should set taskQueue', () => { + userConfig.taskQueue = 'congestionAsync' + const { config } = validateConfig(userConfig); + expect(config.taskQueue).toBe('congestionAsync'); + }); }); diff --git a/src/compiler/config/validate-config.ts b/src/compiler/config/validate-config.ts index d03aa89ec65..dd7fdafc016 100644 --- a/src/compiler/config/validate-config.ts +++ b/src/compiler/config/validate-config.ts @@ -1,5 +1,5 @@ import { Config, ConfigBundle, Diagnostic } from '../../declarations'; -import { buildError, buildWarn, isBoolean, isNumber, sortBy } from '@utils'; +import { buildError, buildWarn, isBoolean, isNumber, isString, sortBy } from '@utils'; import { setBooleanConfig } from './config-utils'; import { validateDevServer } from './validate-dev-server'; import { validateDistNamespace } from './validate-namespace'; @@ -58,11 +58,8 @@ export const validateConfig = (userConfig?: Config) => { setBooleanConfig(config, 'validateTypes', null, !config._isTesting); setBooleanConfig(config, 'allowInlineScripts', null, true); - if (typeof config.taskQueue !== 'string') { - config.taskQueue = 'congestionAsync'; - } else if (config.taskQueue === ('sync' as any)) { - // deprecated 1.12.1 - config.taskQueue = 'immediate'; + if (!isString(config.taskQueue)) { + config.taskQueue = 'async'; } // hash file names