chore: tiny refactoring (#4534)

This commit is contained in:
Xin Du (Clark) 2018-12-12 10:47:54 +00:00 committed by GitHub
parent 28300ee0f9
commit 657a6cc7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View File

@ -16,14 +16,14 @@ export function getDefaultNuxtConfig(options = {}) {
}
return {
..._app(options),
..._common(options),
build: build(options),
messages: messages(options),
modes: modes(options),
render: render(options),
router: router(options),
..._app(),
..._common(),
build: build(),
messages: messages(),
modes: modes(),
render: render(),
router: router(),
server: server(options),
cli: cli(options)
cli: cli()
}
}

View File

@ -85,15 +85,15 @@ export class WebpackBundler {
'Using styleResources without the nuxt-style-resources-module is not suggested and can lead to severe performance issues.',
'Please use https://github.com/nuxt-community/style-resources-module'
)
}
for (const ext of Object.keys(styleResources)) {
await Promise.all(wrapArray(styleResources[ext]).map(async (p) => {
const styleResourceFiles = await glob(path.resolve(this.context.options.rootDir, p))
for (const ext of Object.keys(styleResources)) {
await Promise.all(wrapArray(styleResources[ext]).map(async (p) => {
const styleResourceFiles = await glob(path.resolve(this.context.options.rootDir, p))
if (!styleResourceFiles || styleResourceFiles.length === 0) {
throw new Error(`Style Resource not found: ${p}`)
}
}))
if (!styleResourceFiles || styleResourceFiles.length === 0) {
throw new Error(`Style Resource not found: ${p}`)
}
}))
}
}
// Configure compilers

View File

@ -90,7 +90,7 @@ export default class Package {
async writePackage() {
if (this.options.sortDependencies) {
await this.sortDependencies()
this.sortDependencies()
}
const pkgPath = this.resolvePath(this.options.pkgPath)
this.logger.debug('Writing', pkgPath)