-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
85 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,7 @@ | ||
import { createServer as createViteServer } from 'vite'; | ||
import { indexationAlglolia } from '@/helpers/indexationAlgoliaHelper'; | ||
|
||
const indexationAlglolia = async (): Promise<void> => { | ||
const vite = await createViteServer({ | ||
server: { middlewareMode: true }, | ||
appType: 'custom', | ||
}); | ||
|
||
try { | ||
const { indexationAlglolia } = await vite.ssrLoadModule('/src/helpers/indexationAlgoliaHelper.ts'); | ||
|
||
await indexationAlglolia({ | ||
appId: process.env.ALGOLIA_APP_ID as string, | ||
apiIndexingKey: process.env.ALGOLIA_API_INDEXING_KEY as string, | ||
index: process.env.ALGOLIA_INDEX as string, | ||
}); | ||
} catch (e) { | ||
console.log(e); | ||
} finally { | ||
vite.close(); | ||
} | ||
}; | ||
|
||
indexationAlglolia(); | ||
indexationAlglolia({ | ||
appId: process.env.ALGOLIA_APP_ID as string, | ||
apiIndexingKey: process.env.ALGOLIA_API_INDEXING_KEY as string, | ||
index: process.env.ALGOLIA_INDEX as string, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const getEnv = function <T = string>(key: string): T { | ||
return import.meta.env[key] ?? undefined; | ||
return import.meta?.env ? import.meta.env[key] : undefined; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.