diff --git a/src/targets/cloudflare.ts b/src/targets/cloudflare.ts index a0c759a060..e47522a0c5 100644 --- a/src/targets/cloudflare.ts +++ b/src/targets/cloudflare.ts @@ -1,7 +1,6 @@ import { resolve } from 'path' -import { writeFile } from 'fs-extra' import consola from 'consola' -import { extendTarget, prettyPath } from '../utils' +import { extendTarget, writeFile } from '../utils' import { SLSOptions, SLSTarget } from '../config' import { worker } from './worker' @@ -12,13 +11,9 @@ export const cloudflare: SLSTarget = extendTarget(worker, { ], hooks: { async done ({ targetDir }: SLSOptions) { - const pkgPath = resolve(targetDir, 'package.json') - const pkg = { - private: true, - main: './_nuxt.js' - } - await writeFile(pkgPath, JSON.stringify(pkg, null, 2)) - consola.info('Generated', prettyPath(pkgPath)) + await writeFile(resolve(targetDir, 'package.json'), JSON.stringify({ private: true, main: './_nuxt.js' }, null, 2)) + await writeFile(resolve(targetDir, 'package-lock.json'), JSON.stringify({ lockfileVersion: 1 }, null, 2)) + consola.success('Ready to run `wrangler publish`') } } diff --git a/src/utils.ts b/src/utils.ts index 6264cd9422..d228a8047c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -37,7 +37,7 @@ export function tryImport (dir: string, path: string) { export async function writeFile (file, contents) { await fse.mkdirp(dirname(file)) await fse.writeFile(file, contents, 'utf-8') - consola.info('Generated ', prettyPath(file)) + consola.info('Generated', prettyPath(file)) } export function resolvePath (options: SLSOptions, path: UnresolvedPath, resolveBase: string = '') {