add option to namespace .nuxt

This commit is contained in:
Mouti'a Benachour 2017-05-24 02:05:15 +01:00
parent 923f907442
commit 8473cd3a6b
2 changed files with 6 additions and 3 deletions

View File

@ -110,7 +110,7 @@ export async function build () {
} }
} }
debug(`App root: ${this.srcDir}`) debug(`App root: ${this.srcDir}`)
debug('Generating .nuxt/ files...') debug(`Generating .nuxt/${this.options.build.buildNamespace ? (this.options.build.buildNamespace + '/') : ''} files...`)
// Create .nuxt/, .nuxt/components and .nuxt/dist folders // Create .nuxt/, .nuxt/components and .nuxt/dist folders
await remove(r(this.buildDir)) await remove(r(this.buildDir))
await mkdirp(r(this.buildDir, 'components')) await mkdirp(r(this.buildDir, 'components'))

View File

@ -62,7 +62,9 @@ class Nuxt {
webpack: {}, webpack: {},
chokidar: {} chokidar: {}
}, },
build: {} build: {
buildNamespace: null
}
} }
// Sanitization // Sanitization
if (options.loading === true) delete options.loading if (options.loading === true) delete options.loading
@ -77,7 +79,8 @@ class Nuxt {
// Explicit srcDir, rootDir and buildDir // Explicit srcDir, rootDir and buildDir
this.dir = (typeof options.rootDir === 'string' && options.rootDir ? options.rootDir : process.cwd()) this.dir = (typeof options.rootDir === 'string' && options.rootDir ? options.rootDir : process.cwd())
this.srcDir = (typeof options.srcDir === 'string' && options.srcDir ? resolve(this.dir, options.srcDir) : this.dir) this.srcDir = (typeof options.srcDir === 'string' && options.srcDir ? resolve(this.dir, options.srcDir) : this.dir)
this.buildDir = resolve(this.dir, '.nuxt') this.buildDir = (typeof options.build.buildNamespace === 'string' && options.build.buildNamespace)
? resolve(this.dir, '.nuxt', options.build.buildNamespace) : resolve(this.dir, '.nuxt')
options.rootDir = this.dir options.rootDir = this.dir
options.srcDir = this.srcDir options.srcDir = this.srcDir
options.buildDir = this.buildDir options.buildDir = this.buildDir