Skip to content

Commit

Permalink
refactor const location
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtantay committed Jul 16, 2024
1 parent f7d9450 commit b9f64c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import { NunjucksEngine } from './engines/nunjucks.js';
import { RollupEngine } from './engines/rollup.js';
import { SassEngine } from './engines/sass.js';

const EXT_WHITELIST = ['img', 'avif', 'webp'];

/**
* @typedef {Object} BakerOptions
* @property {string} assets
Expand Down Expand Up @@ -299,10 +301,9 @@ export class Baker extends EventEmitter {
isProductionEnv &&
process.env.BAKER_BASE_PATH &&
process.env.BAKER_PATH_PREFIX;
const extWhitelist = ['img', 'avif', 'webp'];

return data.map((d) => {
extWhitelist.forEach((ext) => {
EXT_WHITELIST.forEach((ext) => {
if (d[ext]) {
const relativeStaticPath = this.getStaticPath(
join(crosswalkPath, d[ext])
Expand Down

0 comments on commit b9f64c0

Please sign in to comment.