diff --git a/util/transformSrc.js b/util/transformSrc.js index bae392a5..9162ebd2 100644 --- a/util/transformSrc.js +++ b/util/transformSrc.js @@ -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 = "") => { @@ -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; } }; \ No newline at end of file