-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bb85ac
commit 602c9e1
Showing
4 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
await Bun.build({ | ||
entrypoints: [ | ||
'src/index.ts', | ||
], | ||
import { $ } from 'bun' | ||
import dts from 'bun-plugin-dts-auto' | ||
|
||
await Bun.build({ | ||
entrypoints: ['./src/index.ts', './bin/cli.ts'], | ||
outdir: './dist', | ||
format: 'esm', | ||
target: 'bun', | ||
|
||
// plugins: [ | ||
// dts(), | ||
// ], | ||
plugins: [ | ||
dts({ | ||
cwd: import.meta.dir, | ||
}), | ||
], | ||
}) | ||
|
||
await $`cp ./dist/src/index.js ./dist/index.js` | ||
await $`rm -rf ./dist/src` | ||
await $`cp ./dist/bin/cli.js ./dist/cli.js` | ||
await $`rm -rf ./dist/bin` | ||
await $`cp ./bin/cli.d.ts ./dist/cli.d.ts` // while bun-plugin-dts-auto doesn't support bin files well | ||
await $`rm ./bin/cli.d.ts` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { log, runCommand } from '@stacksjs/cli' | ||
|
||
// compiles the buddy binary | ||
const result = await runCommand('bun build ./bin/cli.ts --compile --minify --sourcemap --outfile dist/reverse-proxy', { | ||
cwd: import.meta.dir, | ||
}) | ||
|
||
if (result.isErr()) | ||
log.error(result.error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
'localhost:3000': 'stacks.localhost' | ||
} |