-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Showing
3 changed files
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,19 +1,19 @@ | ||
// See https://esbuild.github.io/getting-started/#bundling-for-node. | ||
|
||
import fs from 'node:fs' | ||
|
||
import * as esbuild from 'esbuild' | ||
|
||
// Since this is a library, there's no bundling going on here by design. | ||
// Instead we plan for this library to be bundled by leaf packages so-to-speak like create-redwood-app. | ||
const result = await esbuild.build({ | ||
entryPoints: ['src/index.ts'], | ||
format: 'cjs', | ||
platform: 'node', | ||
target: ['node18'], | ||
outfile: 'dist/index.js', | ||
|
||
// See https://esbuild.github.io/api/#metafile. | ||
// For visualizing the bundle. | ||
// See https://esbuild.github.io/api/#metafile and https://esbuild.github.io/analyze/. | ||
metafile: true, | ||
}) | ||
|
||
// See https://esbuild.github.io/analyze/. | ||
fs.writeFileSync('meta.json', JSON.stringify(result.metafile)) |