mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 00:23:53 +00:00
cloudflare: generate package-lock.json
This commit is contained in:
parent
2a6d4f38d0
commit
dc6154fea8
@ -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`')
|
||||
}
|
||||
}
|
||||
|
@ -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 = '') {
|
||||
|
Loading…
Reference in New Issue
Block a user