Skip to content

Commit

Permalink
chore(deps): bump esbuild to latest
Browse files Browse the repository at this point in the history
and apply mdx-bundler patch (see kentcdodds/mdx-bundler#206)
  • Loading branch information
pkerschbaum committed Feb 10, 2023
1 parent f758096 commit 93acaca
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
"pnpm": "^7.11.0"
},
"pnpm": {
"updateConfig": {
"ignoreDependencies": [
"esbuild"
]
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
}
}
26 changes: 26 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/dist/index.js b/dist/index.js
index 4161f623ba48d04a69ed5358a45a04751f3b9eb1..03b43f76d48b8bd7624a35ea599ce3f6f604bf5e 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -173,15 +173,18 @@ async function bundleMDX({
});
}
};
+ /** @type import('esbuild').BuildOptions["define"] */
+ const define = {}
+ if (process.env.NODE_ENV !== undefined) {
+ define['process.env.NODE_ENV'] = JSON.stringify(process.env.NODE_ENV)
+ }
const buildOptions = esbuildOptions({
entryPoints: [entryPath],
write: isWriting,
outdir: isWriting ? bundleDirectory : undefined,
publicPath: isWriting ? bundlePath : undefined,
absWorkingDir: cwd,
- define: {
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
- },
+ define,
plugins: [(0, _esbuildPluginGlobalExternals.globalExternals)({
...globals,
react: {
12 changes: 9 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tsconfig.workspace.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
/* based on https://pkerschbaum.com/tidbits/sensible-tsconfig-defaults */

"compilerOptions": {
/* Language and Environment */
"target": "ES2018",
Expand Down

1 comment on commit 93acaca

@vercel
Copy link

@vercel vercel bot commented on 93acaca Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.