Skip to content

Commit

Permalink
refactor: improve build config
Browse files Browse the repository at this point in the history
  • Loading branch information
jrson83 committed Jul 15, 2024
1 parent cd6a048 commit 457742d
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions _build.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
const createConfig = (mode?: string) => {
if (typeof mode === 'undefined') {
throw new Error('BUILD_MODE is not defined')
}
if (mode === 'prod') {
return {
mode,
location: new URL('https://jrson.me'),
}
}
return {
mode,
location: new URL('http://localhost'),
}
}
const createConfig = (mode = 'dev') => ({
mode,
location: new URL(mode === 'dev' ? 'http://localhost' : 'https://jrson.me'),
})

const BUILD_MODE = Deno.env.get('BUILD_MODE')

export const config = createConfig(BUILD_MODE)
export const config = createConfig(Deno.env.get('BUILD_MODE'))

0 comments on commit 457742d

Please sign in to comment.