mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Include Vuex only when store is not empty
This commit is contained in:
parent
0a823252ae
commit
d7b1dd53ac
@ -1,7 +1,7 @@
|
||||
const _ = require('lodash')
|
||||
const Debug = require('debug')
|
||||
const { join, resolve } = require('path')
|
||||
const { existsSync } = require('fs')
|
||||
const { existsSync, readdirSync } = require('fs')
|
||||
const { isUrl, isPureObject } = require('../common/utils')
|
||||
|
||||
const debug = Debug('nuxt:build')
|
||||
@ -85,7 +85,12 @@ Options.from = function (_options) {
|
||||
}
|
||||
|
||||
// If store defined, update store options to true unless explicitly disabled
|
||||
if (options.store !== false && existsSync(join(options.srcDir, options.dir.store))) {
|
||||
if (
|
||||
options.store !== false &&
|
||||
existsSync(join(options.srcDir, options.dir.store)) &&
|
||||
readdirSync(join(options.srcDir, options.dir.store))
|
||||
.find(filename => filename !== 'README.md' && filename[0] !== '.')
|
||||
) {
|
||||
options.store = true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user