Skip to content

Commit

Permalink
fix: resolve bug that occur when using npm
Browse files Browse the repository at this point in the history
  • Loading branch information
aiji42 committed Mar 28, 2022
1 parent ba32eda commit e8fc4c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Expand Up @@ -18,14 +18,14 @@ export const withEsbuildOverride = (_esbuildOverride?: EsbuildOverride) => {
if (typeof _esbuildOverride !== "function") return;
esbuildOverride = _esbuildOverride;

for (const mod of ["esbuild", "@remix-run/dev/node_modules/esbuild"]) {
for (const mod of ["@remix-run/dev/node_modules/esbuild", "esbuild"]) {
let esbuild;
try {
esbuild = require(mod);
} catch (_) {
continue;
}
if (esbuild && !esbuild.overridden) break;
if (esbuild.overridden) break;
const originalBuildFunction = esbuild.build;
Object.defineProperty(esbuild, "build", {
get: () => (option: EsbuildOption) => {
Expand Down

0 comments on commit e8fc4c7

Please sign in to comment.