This file contains hidden or 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
| module.exports = { | |
| onPreBuild: () => { | |
| const BRANCH = process.env.BRANCH.toUpperCase().replace(/-/g, '_') | |
| console.log('Vite env plugin starting for branch:', BRANCH) | |
| Object.keys(process.env).sort().forEach(key => { | |
| if (!key.startsWith('VITE_') || key.endsWith(`_${BRANCH}`)) { | |
| return | |
| } | |
| const contextualValue = process.env[`${key}_${BRANCH}`] |
This file contains hidden or 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
| const isLiteralObject = (object => !!object && object.constructor === Object) | |
| function populateWithDotSyntax (object, parent = null) { | |
| return Object.entries(object).reduce((obj, [ key, value ]) => { | |
| const string = parent !== null ? `${parent}.${ key }` : key | |
| if (isLiteralObject(value)) { | |
| obj[key] = populateWithDotSyntax(value, string) | |
| } else if (Array.isArray(value)) { | |
| obj[key] = value.map((i, index) => populateWithDotSyntax(i, `${key}.${index}`)) | |
| } else { |
This file contains hidden or 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
| import type { App } from 'vue' | |
| import { useAppStore, useAuthStore } from '@/stores' | |
| declare module '@vue/runtime-core' { | |
| interface ComponentCustomProperties { | |
| $app: ReturnType<typeof useAppStore> | |
| $auth: ReturnType<typeof useAuthStore> | |
| } | |
| } |
OlderNewer