Skip to content

Commit

Permalink
fix(scripts): make print:crops work
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Sep 1, 2024
1 parent 1346e97 commit 1b34dd5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ export const endpoints = {
* FOREST?: boolean
* }}
*/
export const features = Object.keys(import.meta.env).reduce((acc, key) => {
const matches = key.match(/VITE_ENABLE_(.*)/)
export const features = Object.keys(import.meta.env ?? {}).reduce(
(acc, key) => {
const matches = key.match(/VITE_ENABLE_(.*)/)

if (matches) {
acc[matches[1]] = true
}
if (matches) {
acc[matches[1]] = true
}

return acc
}, {})
return acc
},
{}
)

// Use optional chaining here because window.location will not be defined when
// this is running in a Node.js context.
Expand Down

0 comments on commit 1b34dd5

Please sign in to comment.