Skip to content

Commit

Permalink
update run logic to consume commonjs output
Browse files Browse the repository at this point in the history
  • Loading branch information
Brocco committed May 23, 2024
1 parent b31d732 commit e66b1a6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@herodevs/cli",
"version": "0.0.0",
"bin": "./main.cjs",
"bin": "./hd-cli.js",
"dependencies": {
"tslib": "^2.3.0"
},
"type": "commonjs",
"main": "./main.cjs"
"main": "./hd-cli.js"
}
11 changes: 9 additions & 2 deletions apps/cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
"executor": "@nx/esbuild:esbuild",
"options": {
"outputPath": "dist/apps/cli",
"main": "apps/cli/src/main.ts",
"main": "apps/cli/src/lib/cli.ts",
"tsConfig": "apps/cli/tsconfig.lib.json",
"format": ["cjs"],
"generatePackageJson": true
"generatePackageJson": true,
"assets": [
{
"input": "apps/cli/src/",
"glob": "hd-cli.js",
"output": "/"
}
]
}
},
"nx-release-publish": {
Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/hd-cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('./cli.cjs').cli();
3 changes: 0 additions & 3 deletions apps/cli/src/main.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"hd": "npm run build && node ./dist/apps/cli/src/main.js",
"hd": "npm run build && node ./dist/apps/cli/hd-cli.js",
"build": "nx run-many --target=build --all",
"test": "nx run-many --target=test --all",
"x": "nx affected:test --watch",
Expand Down

0 comments on commit e66b1a6

Please sign in to comment.