mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
refactor(config): alias export
to generate
(#7399)
* refactor: alias option.export to options.generate * chore: keep same references
This commit is contained in:
parent
e9a4ca6ac2
commit
0bdc71c8d8
@ -114,6 +114,13 @@ export function getNuxtConfig (_options) {
|
|||||||
options.router.base += '/'
|
options.router.base += '/'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Alias export to generate
|
||||||
|
// TODO: switch to export by default for nuxt3
|
||||||
|
if (options.export) {
|
||||||
|
options.generate = defu(options.export, options.generate)
|
||||||
|
}
|
||||||
|
exports.export = options.generate
|
||||||
|
|
||||||
// Check srcDir and generate.dir existence
|
// Check srcDir and generate.dir existence
|
||||||
const hasSrcDir = isNonEmptyString(options.srcDir)
|
const hasSrcDir = isNonEmptyString(options.srcDir)
|
||||||
const hasGenerateDir = isNonEmptyString(options.generate.dir)
|
const hasGenerateDir = isNonEmptyString(options.generate.dir)
|
||||||
|
@ -162,6 +162,11 @@ describe('config: options', () => {
|
|||||||
expect(fallback).toEqual('fallback.html')
|
expect(fallback).toEqual('fallback.html')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('export should alias to generate', () => {
|
||||||
|
const { generate: { fallback } } = getNuxtConfig({ export: { fallback: 'fallback.html' } })
|
||||||
|
expect(fallback).toEqual('fallback.html')
|
||||||
|
})
|
||||||
|
|
||||||
test('should disable parallel if extractCSS is enabled', () => {
|
test('should disable parallel if extractCSS is enabled', () => {
|
||||||
const { build: { parallel } } = getNuxtConfig({ build: { extractCSS: true, parallel: true } })
|
const { build: { parallel } } = getNuxtConfig({ build: { extractCSS: true, parallel: true } })
|
||||||
expect(parallel).toEqual(false)
|
expect(parallel).toEqual(false)
|
||||||
|
Loading…
Reference in New Issue
Block a user