Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtantay committed Jun 28, 2024
1 parent cdeb666 commit 1bb3a20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/engines/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ export class RollupEngine extends BaseEngine {
// if we're in production, build the legacy build too
this.manifest.legacy = {};
this.manifest.basePath =
(process.env.BAKER_BASE_PATH && process.env.BAKER_PATH_PREFIX) && normalizeUrlPaths(this.domain);
process.env.BAKER_BASE_PATH &&
process.env.BAKER_PATH_PREFIX &&
normalizeUrlPaths(this.domain);

for (const entrypoint of entrypoints) {
const legacyInput = this.generateLegacyInput(entrypoint);
Expand Down
11 changes: 9 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ export class Baker extends EventEmitter {
this.nunjucks.addCustomTag(
'static',
// preserves the original behavior in development
(isProductionEnv && process.env.BAKER_BASE_PATH && process.env.BAKER_PATH_PREFIX) ? staticAbsoluteBlock : staticBlock
isProductionEnv &&
process.env.BAKER_BASE_PATH &&
process.env.BAKER_PATH_PREFIX
? staticAbsoluteBlock
: staticBlock
);

// save a reference to our static block function for use elsewhere
Expand Down Expand Up @@ -500,7 +504,10 @@ export class Baker extends EventEmitter {
normalizeUrlPaths(this.domain)
).href;
if (d.img) {
const isAbsolutePath = isProductionEnv && process.env.BAKER_BASE_PATH && process.env.BAKER_PATH_PREFIX;
const isAbsolutePath =
isProductionEnv &&
process.env.BAKER_BASE_PATH &&
process.env.BAKER_PATH_PREFIX;
return {
...d,
img: isAbsolutePath ? absoluteUrlSrc : relativeStaticPath,
Expand Down

0 comments on commit 1bb3a20

Please sign in to comment.