Skip to content

Commit

Permalink
fix config file
Browse files Browse the repository at this point in the history
  • Loading branch information
L4Ph committed Jun 1, 2024
1 parent 237e73a commit 61a337b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 407 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"@types/wicg-file-system-access": "^2020.9.7",
"@typescript-eslint/eslint-plugin": "^4.10.0",
"@typescript-eslint/parser": "^7.11.0",
"@vitejs/plugin-react": "^4.3.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"babel-eslint": "^10.1.0",
"eslint": "8.57.0",
Expand Down
10 changes: 5 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ export default defineConfig(({ mode }) => {
},
test: {
globals: true,
environment: "happy-dom",
setupFiles: "setupTests.ts"
environment: 'happy-dom',
setupFiles: 'setupTests.ts',
},
};
});

function envPlugin(): Plugin {
return {
name: "env-plugin",
name: 'env-plugin',
config(_, { mode }) {
const env = loadEnv(mode, ".", ["REACT_APP_", "NODE_ENV", "PUBLIC_URL"]);
const env = loadEnv(mode, '.', ['REACT_APP_', 'NODE_ENV']);
return {
define: Object.fromEntries(
Object.entries(env).map(([key, value]) => [
`import.meta.env.${key}`,
JSON.stringify(value),
]),
])
),
};
},
Expand Down
Loading

0 comments on commit 61a337b

Please sign in to comment.