mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Remove buildNamespace in favor of buildDir
This commit is contained in:
parent
488010bf78
commit
2bb5cca1d5
@ -110,7 +110,7 @@ export async function build () {
|
||||
}
|
||||
}
|
||||
debug(`App root: ${this.srcDir}`)
|
||||
debug(`Generating .nuxt/${this.options.build.buildNamespace ? (this.options.build.buildNamespace + '/') : ''} files...`)
|
||||
debug(`Generating ${this.buildDir} files...`)
|
||||
// Create .nuxt/, .nuxt/components and .nuxt/dist folders
|
||||
await remove(r(this.buildDir))
|
||||
await mkdirp(r(this.buildDir, 'components'))
|
||||
|
@ -52,7 +52,7 @@ class Module {
|
||||
const {dst} = this.addTemplate(template)
|
||||
// Add to nuxt plugins
|
||||
this.options.plugins.push({
|
||||
src: '~/.nuxt/' + dst,
|
||||
src: path.join(this.nuxt.buildDir, dst),
|
||||
ssr: template.ssr
|
||||
})
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ class Nuxt {
|
||||
constructor (options = {}) {
|
||||
const defaults = {
|
||||
dev: true,
|
||||
buildDir: '.nuxt',
|
||||
env: {},
|
||||
head: {
|
||||
meta: [],
|
||||
@ -61,9 +62,6 @@ class Nuxt {
|
||||
watchers: {
|
||||
webpack: {},
|
||||
chokidar: {}
|
||||
},
|
||||
build: {
|
||||
buildNamespace: null
|
||||
}
|
||||
}
|
||||
// Sanitization
|
||||
@ -79,8 +77,7 @@ class Nuxt {
|
||||
// Explicit srcDir, rootDir and buildDir
|
||||
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.buildDir = (typeof options.build.buildNamespace === 'string' && options.build.buildNamespace)
|
||||
? resolve(this.dir, '.nuxt', options.build.buildNamespace) : resolve(this.dir, '.nuxt')
|
||||
this.buildDir = join(this.dir, options.buildDir)
|
||||
options.rootDir = this.dir
|
||||
options.srcDir = this.srcDir
|
||||
options.buildDir = this.buildDir
|
||||
|
@ -26,7 +26,7 @@ test('Vendor', async t => {
|
||||
})
|
||||
|
||||
test('Plugin', async t => {
|
||||
t.true(nuxt.options.plugins[0].src.startsWith('~/.nuxt/basic.reverse'), 'plugin added to config')
|
||||
t.true(nuxt.options.plugins[0].src.includes('fixtures/module/.nuxt/basic.reverse.'), 'plugin added to config')
|
||||
const { html } = await nuxt.renderRoute('/')
|
||||
t.true(html.includes('<h1>TXUN</h1>'), 'plugin works')
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user