Skip to content

Commit

Permalink
fix: add fallback for empty fpcdn and ingress api
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Nov 20, 2023
1 parent a967010 commit 5fefb9d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
* */
Expand Down Expand Up @@ -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,
}),
Expand Down

0 comments on commit 5fefb9d

Please sign in to comment.