Skip to content

Commit

Permalink
[FEATURE] add memory cache to @salesforce/pwa-kit-runtime/utils/ssr-c…
Browse files Browse the repository at this point in the history
…onfig getConfig function SalesforceCommerceCloud#1620
  • Loading branch information
luca-izzo committed Dec 15, 2023
1 parent a68b0f0 commit 7f9f593
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/pwa-kit-runtime/src/utils/ssr-config.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const SUPPORTED_FILE_TYPES = ['js', 'yml', 'yaml', 'json']

const IS_REMOTE = Object.prototype.hasOwnProperty.call(process.env, 'AWS_LAMBDA_FUNCTION_NAME')

const CONFIG_CACHE = new Map();
const CONFIG_CACHE = new Map()

/**
* Returns the express app configuration file in object form. The file will be resolved in the
Expand Down Expand Up @@ -41,7 +41,7 @@ export const getConfig = (opts = {}) => {
const {buildDirectory} = opts

if (CONFIG_CACHE.has(buildDirectory)) {
return CONFIG_CACHE.get(buildDirectory);
return CONFIG_CACHE.get(buildDirectory)
}

const configDirBase = IS_REMOTE ? 'build' : ''
Expand Down Expand Up @@ -92,7 +92,7 @@ export const getConfig = (opts = {}) => {
)
}

CONFIG_CACHE.set(buildDirectory, config);
CONFIG_CACHE.set(buildDirectory, config)

return config
}

0 comments on commit 7f9f593

Please sign in to comment.