Skip to content

Commit

Permalink
Switch to esbuild-plugin-alias-path
Browse files Browse the repository at this point in the history
The repo for `esbuild-plugin-alias` no longer exists, so it seems like
it's no longer supported. `esbuild-plugin-alias-path` also seems to work
and produced no actual build changes!
  • Loading branch information
kylewlacy committed Jan 17, 2024
1 parent 5db48fa commit 21c47f9
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 25 deletions.
28 changes: 15 additions & 13 deletions crates/brioche/runtime/build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as esbuild from "esbuild";
import alias from "esbuild-plugin-alias";
import { aliasPath } from "esbuild-plugin-alias-path";
import * as path from "node:path";

await esbuild.build({
Expand All @@ -14,18 +14,20 @@ await esbuild.build({
"__filename": "\"\"",
},
plugins: [
alias({
assert: path.resolve("./src/compat/node/assert.cjs"),
buffer: path.resolve("./src/compat/node/buffer.cjs"),
crypto: path.resolve("./src/compat/node/crypto.cjs"),
events: path.resolve("./src/compat/node/events.cjs"),
fs: path.resolve("./src/compat/node/fs.cjs"),
module: path.resolve("./src/compat/node/module.cjs"),
os: path.resolve("./src/compat/node/os.cjs"),
path: path.resolve("./src/compat/node/path.cjs"),
stream: path.resolve("./src/compat/node/stream.cjs"),
url: path.resolve("./src/compat/node/url.cjs"),
util: path.resolve("./src/compat/node/util.cjs"),
aliasPath({
alias: {
assert: path.resolve("./src/compat/node/assert.cjs"),
buffer: path.resolve("./src/compat/node/buffer.cjs"),
crypto: path.resolve("./src/compat/node/crypto.cjs"),
events: path.resolve("./src/compat/node/events.cjs"),
fs: path.resolve("./src/compat/node/fs.cjs"),
module: path.resolve("./src/compat/node/module.cjs"),
os: path.resolve("./src/compat/node/os.cjs"),
path: path.resolve("./src/compat/node/path.cjs"),
stream: path.resolve("./src/compat/node/stream.cjs"),
url: path.resolve("./src/compat/node/url.cjs"),
util: path.resolve("./src/compat/node/util.cjs"),
},
}),
],
});
109 changes: 98 additions & 11 deletions crates/brioche/runtime/package-lock.json

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

2 changes: 1 addition & 1 deletion crates/brioche/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"@types/eslint": "^8.56.2",
"esbuild": "^0.19.2",
"esbuild-plugin-alias": "^0.2.1"
"esbuild-plugin-alias-path": "^2.0.2"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.19.0",
Expand Down

0 comments on commit 21c47f9

Please sign in to comment.