mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
style: lint
This commit is contained in:
parent
38e72f86c2
commit
c1188eebd5
@ -8,6 +8,7 @@ import hash from 'hash-sum'
|
|||||||
import pify from 'pify'
|
import pify from 'pify'
|
||||||
import upath from 'upath'
|
import upath from 'upath'
|
||||||
import semver from 'semver'
|
import semver from 'semver'
|
||||||
|
import type { RouteLocationRaw } from 'vue-router'
|
||||||
|
|
||||||
import debounce from 'lodash/debounce'
|
import debounce from 'lodash/debounce'
|
||||||
import omit from 'lodash/omit'
|
import omit from 'lodash/omit'
|
||||||
@ -36,7 +37,6 @@ import {
|
|||||||
import Ignore from './ignore'
|
import Ignore from './ignore'
|
||||||
import BuildContext from './context/build'
|
import BuildContext from './context/build'
|
||||||
import TemplateContext from './context/template'
|
import TemplateContext from './context/template'
|
||||||
import { RouteLocationRaw } from 'vue-router'
|
|
||||||
|
|
||||||
const glob = pify(Glob)
|
const glob = pify(Glob)
|
||||||
export default class Builder {
|
export default class Builder {
|
||||||
|
@ -17,7 +17,7 @@ export default class TemplateContext {
|
|||||||
nuxtOptions: options,
|
nuxtOptions: options,
|
||||||
features: options.features,
|
features: options.features,
|
||||||
extensions: options.extensions
|
extensions: options.extensions
|
||||||
.map(ext => ext.replace(/^\./, ''))
|
.map((ext: string) => ext.replace(/^\./, ''))
|
||||||
.join('|'),
|
.join('|'),
|
||||||
messages: options.messages,
|
messages: options.messages,
|
||||||
splitChunks: options.build.splitChunks,
|
splitChunks: options.build.splitChunks,
|
||||||
|
@ -17,7 +17,7 @@ export default {
|
|||||||
alias: 'a',
|
alias: 'a',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: 'Launch webpack-bundle-analyzer to optimize your bundles',
|
description: 'Launch webpack-bundle-analyzer to optimize your bundles',
|
||||||
prepare (cmd: NuxtCommand, options, argv: ParsedArgs) {
|
prepare (_cmd: NuxtCommand, options, argv: ParsedArgs) {
|
||||||
// Analyze option
|
// Analyze option
|
||||||
options.build = options.build || {}
|
options.build = options.build || {}
|
||||||
if (argv.analyze && typeof options.build.analyze !== 'object') {
|
if (argv.analyze && typeof options.build.analyze !== 'object') {
|
||||||
@ -29,7 +29,7 @@ export default {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
description: 'Enable Vue devtools',
|
description: 'Enable Vue devtools',
|
||||||
prepare (cmd: NuxtCommand, options, argv: ParsedArgs) {
|
prepare (_cmd: NuxtCommand, options, argv: ParsedArgs) {
|
||||||
options.vue = options.vue || {}
|
options.vue = options.vue || {}
|
||||||
options.vue.config = options.vue.config || {}
|
options.vue.config = options.vue.config || {}
|
||||||
if (argv.devtools) {
|
if (argv.devtools) {
|
||||||
@ -46,7 +46,7 @@ export default {
|
|||||||
alias: 'q',
|
alias: 'q',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: 'Disable output except for errors',
|
description: 'Disable output except for errors',
|
||||||
prepare (cmd: NuxtCommand, options, argv: ParsedArgs) {
|
prepare (_cmd: NuxtCommand, options, argv: ParsedArgs) {
|
||||||
// Silence output when using --quiet
|
// Silence output when using --quiet
|
||||||
options.build = options.build || {}
|
options.build = options.build || {}
|
||||||
if (argv.quiet) {
|
if (argv.quiet) {
|
||||||
@ -58,7 +58,7 @@ export default {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
description: 'Bundle all server dependencies (useful for nuxt-start)',
|
description: 'Bundle all server dependencies (useful for nuxt-start)',
|
||||||
prepare (cmd: NuxtCommand, options, argv: ParsedArgs) {
|
prepare (_cmd: NuxtCommand, options, argv: ParsedArgs) {
|
||||||
if (argv.standalone) {
|
if (argv.standalone) {
|
||||||
options.build.standalone = true
|
options.build.standalone = true
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ export default {
|
|||||||
return nuxt
|
return nuxt
|
||||||
},
|
},
|
||||||
|
|
||||||
async _listenDev (cmd: NuxtCommand, argv) {
|
async _listenDev (cmd: NuxtCommand, argv: ParsedArgs) {
|
||||||
const config = await cmd.getNuxtConfig({ dev: true, _build: true })
|
const config = await cmd.getNuxtConfig({ dev: true, _build: true })
|
||||||
const nuxt = await cmd.getNuxt(config)
|
const nuxt = await cmd.getNuxt(config)
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ export default {
|
|||||||
return nuxt
|
return nuxt
|
||||||
},
|
},
|
||||||
|
|
||||||
async _buildDev (cmd: NuxtCommand, argv: ParsedArgs, nuxt: Nuxt) {
|
async _buildDev (cmd: NuxtCommand, _argv: ParsedArgs, nuxt: Nuxt) {
|
||||||
// Create builder instance
|
// Create builder instance
|
||||||
const builder = await cmd.getBuilder(nuxt)
|
const builder = await cmd.getBuilder(nuxt)
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ export default {
|
|||||||
return nuxt
|
return nuxt
|
||||||
},
|
},
|
||||||
|
|
||||||
logChanged ({ event, path }) {
|
logChanged ({ event, path }: { event: keyof typeof eventsMapping, path: string }) {
|
||||||
const { icon, color, action } = eventsMapping[event] || eventsMapping.change
|
const { icon, color, action } = eventsMapping[event] || eventsMapping.change
|
||||||
|
|
||||||
consola.log({
|
consola.log({
|
||||||
|
Loading…
Reference in New Issue
Block a user