mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
fix constructor order logic
This commit is contained in:
parent
277aa7e6fa
commit
5ba7d593aa
10
lib/nuxt.js
10
lib/nuxt.js
@ -31,6 +31,11 @@ export default class Nuxt extends Tapable {
|
||||
// Apply defaults
|
||||
this.options = _.defaultsDeep(options, Nuxt.Defaults)
|
||||
|
||||
// Resolve dirs
|
||||
this.options.rootDir = (typeof options.rootDir === 'string' && options.rootDir ? options.rootDir : process.cwd())
|
||||
this.options.srcDir = (typeof options.srcDir === 'string' && options.srcDir ? resolve(options.rootDir, options.srcDir) : this.options.rootDir)
|
||||
this.options.buildDir = join(this.options.rootDir, options.buildDir)
|
||||
|
||||
// If store defined, update store options to true
|
||||
if (fs.existsSync(join(this.options.srcDir, 'store'))) {
|
||||
this.options.store = true
|
||||
@ -42,11 +47,6 @@ export default class Nuxt extends Tapable {
|
||||
this.options.appTemplatePath = join(this.options.srcDir, 'app.html')
|
||||
}
|
||||
|
||||
// Resolve dirs
|
||||
this.options.rootDir = (typeof options.rootDir === 'string' && options.rootDir ? options.rootDir : process.cwd())
|
||||
this.options.srcDir = (typeof options.srcDir === 'string' && options.srcDir ? resolve(options.rootDir, options.srcDir) : this.options.rootDir)
|
||||
this.options.buildDir = join(this.options.rootDir, options.buildDir)
|
||||
|
||||
// Create instance of core components
|
||||
this.moduleContainer = new Nuxt.ModuleContainer(this)
|
||||
this.builder = new Nuxt.Builder(this)
|
||||
|
Loading…
Reference in New Issue
Block a user