Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Commit 4a4b080

Browse files
committed
feat: target esm
1 parent 0ace16b commit 4a4b080

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
2727
with:
2828
name: containerbase-cli
29-
path: ./dist/containerbase-cli-*
29+
path: ./dist/pkg/containerbase-cli-*

esbuild.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import { exec } from "pkg";
55
await build({
66
entryPoints: ["src/index.ts"],
77
bundle: true,
8-
outfile: "dist/containerbase-cli.js",
8+
platform: "node",
9+
target: "node18",
10+
minify: true,
11+
outfile: "./dist/esbuild/containerbase-cli.js",
912
});
1013

1114
await exec([
1215
"--targets",
1316
"node18-linux-x64,node18-linux-arm64,node18-alpine-x64,node18-alpine-arm64",
1417
"--out-path",
15-
"dist",
16-
"--debug",
17-
"dist/containerbase-cli.js",
18+
"./dist/pkg",
19+
"--public",
20+
"./dist/esbuild/containerbase-cli.js",
1821
]);
1922
})();

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"name": "containerbase-cli",
33
"version": "0.0.0",
44
"license": "MIT",
5+
"private": true,
6+
"type": "module",
57
"scripts": {
68
"build": "tsx esbuild.ts",
79
"start": "tsx src/index.ts"

tsconfig.json

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
22
"extends": "@tsconfig/node18/tsconfig.json",
3-
"compilerOptions": {
4-
"module": "CommonJS"
5-
}
63
}

0 commit comments

Comments
 (0)