Skip to content

Commit e66b1a6

Browse files
committed
update run logic to consume commonjs output
1 parent b31d732 commit e66b1a6

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

apps/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@herodevs/cli",
33
"version": "0.0.0",
4-
"bin": "./main.cjs",
4+
"bin": "./hd-cli.js",
55
"dependencies": {
66
"tslib": "^2.3.0"
77
},
88
"type": "commonjs",
9-
"main": "./main.cjs"
9+
"main": "./hd-cli.js"
1010
}

apps/cli/project.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@
1717
"executor": "@nx/esbuild:esbuild",
1818
"options": {
1919
"outputPath": "dist/apps/cli",
20-
"main": "apps/cli/src/main.ts",
20+
"main": "apps/cli/src/lib/cli.ts",
2121
"tsConfig": "apps/cli/tsconfig.lib.json",
2222
"format": ["cjs"],
23-
"generatePackageJson": true
23+
"generatePackageJson": true,
24+
"assets": [
25+
{
26+
"input": "apps/cli/src/",
27+
"glob": "hd-cli.js",
28+
"output": "/"
29+
}
30+
]
2431
}
2532
},
2633
"nx-release-publish": {

apps/cli/src/hd-cli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('./cli.cjs').cli();

apps/cli/src/main.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"license": "MIT",
55
"scripts": {
6-
"hd": "npm run build && node ./dist/apps/cli/src/main.js",
6+
"hd": "npm run build && node ./dist/apps/cli/hd-cli.js",
77
"build": "nx run-many --target=build --all",
88
"test": "nx run-many --target=test --all",
99
"x": "nx affected:test --watch",

0 commit comments

Comments
 (0)