diff --git a/lib/common/options.js b/lib/common/options.js index cfd9c3b142..865553713e 100644 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -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 }