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 { return {
..._app(options), ..._app(),
..._common(options), ..._common(),
build: build(options), build: build(),
messages: messages(options), messages: messages(),
modes: modes(options), modes: modes(),
render: render(options), render: render(),
router: router(options), router: router(),
server: server(options), 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.', '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' 'Please use https://github.com/nuxt-community/style-resources-module'
) )
} for (const ext of Object.keys(styleResources)) {
for (const ext of Object.keys(styleResources)) { await Promise.all(wrapArray(styleResources[ext]).map(async (p) => {
await Promise.all(wrapArray(styleResources[ext]).map(async (p) => { const styleResourceFiles = await glob(path.resolve(this.context.options.rootDir, p))
const styleResourceFiles = await glob(path.resolve(this.context.options.rootDir, p))
if (!styleResourceFiles || styleResourceFiles.length === 0) { if (!styleResourceFiles || styleResourceFiles.length === 0) {
throw new Error(`Style Resource not found: ${p}`) throw new Error(`Style Resource not found: ${p}`)
} }
})) }))
}
} }
// Configure compilers // Configure compilers

View File

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