mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
fix: nuxt-start-edge missing resources
This commit is contained in:
parent
67528f1ba3
commit
aeb33e0c94
@ -1,15 +1,16 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const { resolve } = require('path')
|
const { resolve, join } = require('path')
|
||||||
const { spawnSync } = require('child_process')
|
const { spawnSync } = require('child_process')
|
||||||
const { readFileSync, writeFileSync, copySync, ensureDirSync } = require('fs-extra')
|
const { readFileSync, writeFileSync, copySync } = require('fs-extra')
|
||||||
|
|
||||||
class NuxtEdgePublisher {
|
class NuxtEdgePublisher {
|
||||||
static copyBin(moduleName, binName) {
|
static copyFiles(moduleName, src, fieNames) {
|
||||||
const binFile = resolve(__dirname, '..', 'bin', binName)
|
const srcDir = resolve(__dirname, '..', src)
|
||||||
const moduleBin = resolve(__dirname, '..', moduleName, 'bin')
|
const moduleDir = resolve(__dirname, '..', moduleName, src)
|
||||||
ensureDirSync(moduleBin)
|
for (const file of fieNames) {
|
||||||
copySync(binFile, resolve(moduleBin, binName))
|
copySync(resolve(srcDir, file), resolve(moduleDir, file))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static changePackageName(module = '') {
|
static changePackageName(module = '') {
|
||||||
@ -43,7 +44,8 @@ class NuxtEdgePublisher {
|
|||||||
writeFileSync(packagePath, JSON.stringify(p, null, 2) + '\r\n')
|
writeFileSync(packagePath, JSON.stringify(p, null, 2) + '\r\n')
|
||||||
|
|
||||||
if (module === 'start') {
|
if (module === 'start') {
|
||||||
this.copyBin('start', 'nuxt-start')
|
this.copyFiles(module, 'dist', ['nuxt-start.js'])
|
||||||
|
this.copyFiles(module, 'bin', ['nuxt-start', join('common', 'utils.js')])
|
||||||
}
|
}
|
||||||
|
|
||||||
return p
|
return p
|
||||||
|
Loading…
Reference in New Issue
Block a user