From b9f64c06c05b8c4f33ab0c609ecf8efa3cde61a3 Mon Sep 17 00:00:00 2001 From: "C. J. Tantay" Date: Tue, 16 Jul 2024 11:47:50 -0700 Subject: [PATCH] refactor const location --- lib/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index c09762a2..040dbbe8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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 @@ -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])