improve link mode detection

don't use dist unless inside an npm package or explicitly used
This commit is contained in:
Pooya Parsa 2018-03-28 10:02:32 +04:30
parent b5c3eabbaa
commit aad15b5a5c

View File

@ -6,9 +6,10 @@
*/ */
const fs = require('fs') const fs = require('fs')
const path = require('path')
if (fs.existsSync('dist/nuxt.js')) { if (fs.existsSync(path.resolve(__dirname, '.babelrc'))) {
module.exports = require('./dist/nuxt.js')
} else {
module.exports = require('./lib/index.js') module.exports = require('./lib/index.js')
} else {
module.exports = require('./dist/nuxt.js')
} }