-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to using esbuild to compile + bundle `@vercel/static-build`.
- Loading branch information
1 parent
50e04dd
commit b265e13
Showing
5 changed files
with
31 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@vercel/static-build': patch | ||
--- | ||
|
||
Build package using "esbuild" |
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
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,20 @@ | ||
/** | ||
* This script is the build configuration common to all our Builder packages. | ||
* We bundle the output using `esbuild`, and do not publish type definitions. | ||
* | ||
* `@vercel/build-utils` is marked as external because it's always an implicit | ||
* dependency when the Builder is invoked by `vercel build`. | ||
*/ | ||
import { join } from 'node:path'; | ||
import { readFileSync } from 'node:fs'; | ||
import { esbuild } from './build.mjs'; | ||
|
||
const pkgPath = join(process.cwd(), 'package.json'); | ||
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')); | ||
|
||
const externals = Object.keys(pkg.dependencies || {}); | ||
|
||
await esbuild({ | ||
bundle: true, | ||
external: ['@vercel/build-utils', ...externals], | ||
}); |