Skip to content

Commit cb0b144

Browse files
Merge branch 'main' into diagnostics-app-schema
2 parents 5446f2f + e549509 commit cb0b144

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

demos/angular-supabase-todolist/extra-webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = (config, options, targetOptions) => {
1818
...config.plugins,
1919
new webpack.DefinePlugin({
2020
// Embed environment variables starting with `WEBPACK_PUBLIC_`
21-
'process.env': JSON.stringify(
21+
env: JSON.stringify(
2222
Object.fromEntries(Object.entries(process.env).filter(([key]) => key.startsWith('WEBPACK_PUBLIC_')))
2323
)
2424
})

demos/angular-supabase-todolist/src/env.d.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const environment = {
2-
supabaseUrl: process.env.WEBPACK_PUBLIC_SUPABASE_URL,
3-
supabaseKey: process.env.WEBPACK_PUBLIC_SUPABASE_ANON_KEY,
4-
powersyncUrl: process.env.WEBPACK_PUBLIC_POWERSYNC_URL
2+
supabaseUrl: env.WEBPACK_PUBLIC_SUPABASE_URL,
3+
supabaseKey: env.WEBPACK_PUBLIC_SUPABASE_ANON_KEY,
4+
powersyncUrl: env.WEBPACK_PUBLIC_POWERSYNC_URL
55
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Ambient declarations for webpack-injected environment variables.
2+
// webpack's DefinePlugin injects `env` at build time.
3+
4+
declare global {
5+
const env: {
6+
WEBPACK_PUBLIC_SUPABASE_URL: string;
7+
WEBPACK_PUBLIC_SUPABASE_ANON_KEY: string;
8+
WEBPACK_PUBLIC_POWERSYNC_URL: string;
9+
};
10+
}
11+
12+
export {};

0 commit comments

Comments
 (0)