Skip to content

Commit

Permalink
Revert "Use path.join in transformSrc"
Browse files Browse the repository at this point in the history
This reverts commit 72262aa.
  • Loading branch information
3b1b committed Jan 24, 2024
1 parent 72262aa commit 273e2d3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions util/transformSrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { bucket } from "../data/site.yaml";
const path = require('path');

// change provided srcs (png & mp4) to external bucket location for production.
export const transformSrc = (src, dir = "") => {
Expand All @@ -11,11 +10,11 @@ export const transformSrc = (src, dir = "") => {
return src;
} else if (
process.env.NODE_ENV === "production" &&
// process.env.NEXT_PUBLIC_NETLIFY_CONTEXT === "production" && // Not a deploy preview
process.env.NEXT_PUBLIC_NETLIFY_CONTEXT === "production" && // Not a deploy preview
!src.endsWith("svg")
) {
return path.join(bucket, dir, src);
return bucket + dir + src;
} else {
return path.join(dir, src);
return dir + src;
}
};

0 comments on commit 273e2d3

Please sign in to comment.