-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update devdependency eslint to v7
- Loading branch information
Showing
81 changed files
with
1,502 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import path from 'path' | ||
import consola from 'consola' | ||
import { TARGETS } from '@nuxt/utils' | ||
import { common, locking } from '../options' | ||
import { createLock } from '../utils' | ||
|
||
export default { | ||
name: 'export', | ||
description: 'Export a static generated web application', | ||
usage: 'export <dir>', | ||
options: { | ||
...common, | ||
...locking, | ||
'fail-on-error': { | ||
type: 'boolean', | ||
default: false, | ||
description: 'Exit with non-zero status code if there are errors when exporting pages' | ||
} | ||
}, | ||
async run (cmd) { | ||
const config = await cmd.getNuxtConfig({ | ||
dev: false, | ||
target: TARGETS.static, | ||
_export: true | ||
}) | ||
const nuxt = await cmd.getNuxt(config) | ||
|
||
if (cmd.argv.lock) { | ||
await cmd.setLock(await createLock({ | ||
id: 'export', | ||
dir: nuxt.options.generate.dir, | ||
root: config.rootDir | ||
})) | ||
} | ||
|
||
const generator = await cmd.getGenerator(nuxt) | ||
await nuxt.server.listen() | ||
|
||
const { errors } = await generator.generate({ | ||
init: true, | ||
build: false | ||
}) | ||
|
||
await nuxt.close() | ||
if (cmd.argv['fail-on-error'] && errors.length > 0) { | ||
throw new Error('Error exporting pages, exiting with non-zero code') | ||
} | ||
consola.info('Ready to run `nuxt serve` or deploy `' + path.basename(nuxt.options.generate.dir) + '/` directory') | ||
} | ||
} |
Oops, something went wrong.