Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Ciber94 committed Oct 8, 2023
1 parent df4b9c9 commit 8a8d530
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions examples/sveltekit-mal-auth/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills';
import dotenv from 'dotenv';
dotenv.config();

const defineProcessEnv = () => {
const definedEnvs = Object.fromEntries(
Object.entries(process.env || {}).map(([key, value]) => [
`process.env.${key}`,
JSON.stringify(value),
])
);

return definedEnvs;
};

export default defineConfig({
plugins: [sveltekit(), nodePolyfills()],
server: {
Expand All @@ -12,7 +23,5 @@ export default defineConfig({
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
define: {
'process.versions': JSON.stringify(process.versions)
}
define: defineProcessEnv()
});

0 comments on commit 8a8d530

Please sign in to comment.