2018-03-27 22:28:17 +00:00
|
|
|
/*!
|
|
|
|
* Nuxt.js
|
|
|
|
* (c) 2016-2018 Chopin Brothers
|
|
|
|
* Core maintainers: Pooya Parsa (@pi0) - Clark Du (@clarkdo)
|
|
|
|
* Released under the MIT License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const fs = require('fs')
|
2018-03-28 05:32:32 +00:00
|
|
|
const path = require('path')
|
2018-06-01 12:26:13 +00:00
|
|
|
const semver = require('semver')
|
2018-03-27 22:28:17 +00:00
|
|
|
|
2018-06-01 12:26:13 +00:00
|
|
|
const { engines } = require('./package.json')
|
|
|
|
|
|
|
|
if (!semver.satisfies(process.version, engines.node)) {
|
|
|
|
// Auto fallback to legacy build on older node versions
|
|
|
|
module.exports = require('./dist/nuxt-legacy.js')
|
|
|
|
} else if (fs.existsSync(path.resolve(__dirname, '.babelrc'))) {
|
|
|
|
// Use esm version when using linked repository to prevent builds
|
2018-03-27 22:28:17 +00:00
|
|
|
module.exports = require('./lib/index.js')
|
2018-03-28 05:32:32 +00:00
|
|
|
} else {
|
2018-06-01 12:26:13 +00:00
|
|
|
// Use production bundle by default
|
2018-03-28 05:32:32 +00:00
|
|
|
module.exports = require('./dist/nuxt.js')
|
2018-03-27 22:28:17 +00:00
|
|
|
}
|