mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 13:56:29 +02:00
Add allowing push notifications
This commit is contained in:
@@ -125,4 +125,28 @@ const config = (isWeb = false): Configuration => ({
|
||||
},
|
||||
})
|
||||
|
||||
export function getClientEnvironment(allowedKeys: string[]): any {
|
||||
const raw = Object.keys(process.env)
|
||||
// Custom regex to allow only a certain category of variables available to the application
|
||||
.filter((key) => allowedKeys.indexOf(key) >= 0)
|
||||
.reduce(
|
||||
(env: any, key: string) => {
|
||||
env[key] = process.env[key]
|
||||
return env
|
||||
},
|
||||
{
|
||||
NODE_ENV: process.env.NODE_ENV || "development",
|
||||
}
|
||||
)
|
||||
// Stringify all values so we can feed into Webpack DefinePlugin
|
||||
const stringified = {
|
||||
"process.env": Object.keys(raw).reduce((env: any, key: string) => {
|
||||
env[key] = JSON.stringify(raw[key])
|
||||
return env
|
||||
}, {}),
|
||||
}
|
||||
|
||||
return stringified
|
||||
}
|
||||
|
||||
export default config
|
||||
|
Reference in New Issue
Block a user