Skip to content

Commit

Permalink
feature: add bin file (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Aug 27, 2024
1 parent 3a5db3e commit 46d8a7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0-dev",
"description": "Preview Process",
"main": "src/previewProcessMain.ts",
"bin": "./bin/previewProcess.js",
"type": "module",
"scripts": {
"test": "node --unhandled-rejections=warn --experimental-vm-modules ./node_modules/jest/bin/jest.js --detectOpenHandles --forceExit",
Expand Down
9 changes: 9 additions & 0 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,14 @@ packageJson.main = 'dist/index.js'

await writeJson(join(dist, 'package.json'), packageJson)

await mkdir(join(dist, 'bin'))
await writeFile(
join(dist, 'bin', 'previewProcess.js'),
`#!/usr/bin/env node
import '../dist/index.js'
`,
)

await cp(join(root, 'README.md'), join(dist, 'README.md'))
await cp(join(root, 'LICENSE'), join(dist, 'LICENSE'))

0 comments on commit 46d8a7b

Please sign in to comment.