-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add esbuild for dev to dual package approach.
- Loading branch information
1 parent
15b6a39
commit df9b841
Showing
23 changed files
with
505 additions
and
27 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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
node build.js |
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,6 +1,11 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
npm install | ||
if [ "$CI" = "true" ]; then | ||
npm ci | ||
else | ||
npm install | ||
fi | ||
|
||
node test/products/create.js | ||
node test/products/index.js |
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,27 @@ | ||
import * as esbuild from "esbuild"; | ||
|
||
async function build() { | ||
// Build ESM version | ||
await esbuild.build({ | ||
entryPoints: ["src/index.js"], | ||
outfile: "dist/index.js", | ||
format: "esm", | ||
platform: "node", | ||
target: "node14", | ||
bundle: true, | ||
}); | ||
|
||
// Build CommonJS version | ||
await esbuild.build({ | ||
entryPoints: ["src/index.js"], | ||
outfile: "dist/index.cjs", | ||
format: "cjs", | ||
platform: "node", | ||
target: "node14", | ||
bundle: true, | ||
}); | ||
|
||
console.log("Build complete"); | ||
} | ||
|
||
build().catch(console.error); |
Oops, something went wrong.