Skip to content

Commit

Permalink
fix: Env working locally and in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Dec 10, 2024
1 parent ca40a66 commit 4a3231c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ module.exports = configure(function (ctx) {
viteConf.plugins = [
...viteConf.plugins,
nodePolyfills(),
EnvironmentPlugin('all', {
prefix: 'APP.',
defineOn: 'import.meta.env',
}),
EnvironmentPlugin('all', { defineOn: 'import.meta.env' }),
];
if (ctx.dev) {
viteConf.define['process.browser'] = true;
Expand Down
10 changes: 1 addition & 9 deletions src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ const envSchema = z.object({
WAGMI_BASE_ID: z.union([z.literal(base.id), z.literal(baseSepolia.id)]).default(base.id),
});

const env = envSchema.parse(
Object.keys(import.meta.env).reduce(
(acc, key) => ({
...acc,
...{ [key.replace('APP.', '')]: import.meta.env[key] },
}),
{},
),
);
const env = envSchema.parse(import.meta.env);

export default env;

0 comments on commit 4a3231c

Please sign in to comment.