Skip to content

Commit

Permalink
Merge branch 'dev' into fix/spa-generate
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed May 20, 2020
2 parents b436a5d + 0bdc71c commit 52857f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/config/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ export function getNuxtConfig (_options) {
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
const hasSrcDir = isNonEmptyString(options.srcDir)
const hasGenerateDir = isNonEmptyString(options.generate.dir)
Expand Down
5 changes: 5 additions & 0 deletions packages/config/test/options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ describe('config: options', () => {
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', () => {
const { build: { parallel } } = getNuxtConfig({ build: { extractCSS: true, parallel: true } })
expect(parallel).toEqual(false)
Expand Down

0 comments on commit 52857f3

Please sign in to comment.