mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-03 19:07:15 +00:00
Merge pull request #2909 from liborvanek/dev
Include Vuex only when store is not empty
This commit is contained in:
commit
f412827570
@ -1,7 +1,7 @@
|
|||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const Debug = require('debug')
|
const Debug = require('debug')
|
||||||
const { join, resolve } = require('path')
|
const { join, resolve } = require('path')
|
||||||
const { existsSync } = require('fs')
|
const { existsSync, readdirSync } = require('fs')
|
||||||
const { isUrl, isPureObject } = require('../common/utils')
|
const { isUrl, isPureObject } = require('../common/utils')
|
||||||
|
|
||||||
const debug = Debug('nuxt:build')
|
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 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
|
options.store = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user