fix(dist): use -edge suffix to require cli

also prefer lazy requires. [release]
This commit is contained in:
pooya parsa 2019-01-05 00:40:18 +03:30
parent cc358b54c4
commit 98c1922770
4 changed files with 14 additions and 17 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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()