diff --git a/distributions/nuxt-legacy/bin/nuxt-legacy.js b/distributions/nuxt-legacy/bin/nuxt-legacy.js index 741e63bb38..041e3798fb 100755 --- a/distributions/nuxt-legacy/bin/nuxt-legacy.js +++ b/distributions/nuxt-legacy/bin/nuxt-legacy.js @@ -1,10 +1,8 @@ #!/usr/bin/env node -const register = require('@babel/register') - require('@babel/polyfill') -register({ +require('@babel/register')({ presets: [ [ '@babel/env', { targets: { node: 'current' } } ] ], @@ -24,4 +22,5 @@ register({ ] }) -require('@nuxt/cli').run() +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' +require('@nuxt/cli' + suffix).run() diff --git a/distributions/nuxt-start/bin/nuxt-start.js b/distributions/nuxt-start/bin/nuxt-start.js index ad9b96e59e..da15dfd48d 100755 --- a/distributions/nuxt-start/bin/nuxt-start.js +++ b/distributions/nuxt-start/bin/nuxt-start.js @@ -1,8 +1,8 @@ #!/usr/bin/env node -const { name } = require('../package.json') -const isEdge = name.indexOf('-edge') !== -1 -const cli = require(isEdge ? '@nuxt/cli-edge' : '@nuxt/cli') + if (process.argv[2] !== 'start') { process.argv.splice(2, 0, 'start') } -cli.run() + +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' +require('@nuxt/cli' + suffix).run() diff --git a/distributions/nuxt-ts/bin/nuxt-ts.js b/distributions/nuxt-ts/bin/nuxt-ts.js index 9439bb94c1..47d3803b78 100644 --- a/distributions/nuxt-ts/bin/nuxt-ts.js +++ b/distributions/nuxt-ts/bin/nuxt-ts.js @@ -1,11 +1,10 @@ #!/usr/bin/env node -const { register } = require('ts-node') - -// globally indicate we are running in ts mode +// Globally indicate we are running in ts mode process.env.NUXT_TS = 'true' // https://github.com/TypeStrong/ts-node -register() +require('ts-node').register() -require('@nuxt/cli').run() +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' +require('@nuxt/cli' + suffix).run() diff --git a/distributions/nuxt/bin/nuxt.js b/distributions/nuxt/bin/nuxt.js index 6496c3d2b2..307c8f5e2a 100755 --- a/distributions/nuxt/bin/nuxt.js +++ b/distributions/nuxt/bin/nuxt.js @@ -1,5 +1,4 @@ #!/usr/bin/env node -const { name } = require('../package.json') -const isEdge = name.indexOf('-edge') !== -1 -const cli = require(isEdge ? '@nuxt/cli-edge' : '@nuxt/cli') -cli.run() + +const suffix = require('../package.json').name.includes('-edge') ? '-edge' : '' +require('@nuxt/cli' + suffix).run()