From 5fefb9d1a69177c81769e3f5bc115b9deead0db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 20 Nov 2023 20:25:34 +0200 Subject: [PATCH] fix: add fallback for empty fpcdn and ingress api --- rollup.config.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 87403f2f..13b9348a 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -32,6 +32,11 @@ function makeConfig(opts, entryFile, artifactName, functionJsonPath, transformFu }, }) + const env = { + fpcnd: process.env.FPCDN ?? 'fpcdn.io', + ingressApi: process.env.INGRESS_API ?? 'api.fpjs.io', + } + /** * @type {import('rollup').RollupOptions} * */ @@ -69,8 +74,8 @@ function makeConfig(opts, entryFile, artifactName, functionJsonPath, transformFu commonjs(), nodeResolve({ preferBuiltins: false, exportConditions: ['node'] }), replace({ - __FPCDN__: process.env.FPCDN, - __INGRESS_API__: process.env.INGRESS_API, + __FPCDN__: env.fpcnd, + __INGRESS_API__: env.ingressApi, __azure_function_version__: packageJson.version, preventAssignment: true, }),