mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
Explicit srcDir and rootDir
This makes dir and srcDir consistent and explicitly defined in both places.
This commit is contained in:
parent
ffefa6d724
commit
252e5cce0a
@ -68,8 +68,11 @@ class Nuxt {
|
||||
this.options = _.defaultsDeep(options, defaults)
|
||||
// Env variables
|
||||
this.dev = this.options.dev
|
||||
// Explicit srcDir and rootDir
|
||||
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)
|
||||
options.rootDir = this.dir
|
||||
options.srcDir = this.srcDir
|
||||
// If store defined, update store options to true
|
||||
if (fs.existsSync(join(this.srcDir, 'store'))) {
|
||||
this.options.store = true
|
||||
|
Loading…
Reference in New Issue
Block a user