Felicio Mununga a083d3251b
Install js-waku@^0.25.0 (#307)
* install `js-waku@^0.24.0`

* install `js-waku@^0.25.0`

* resolve some breaking changes

* add timeout

* upgrade `eslint-import-resolver-typescript`

* add `process.env.VITEST` condition

* increase timeout

* fixup

* ignore `emitSelf`

* replace `parcel` with `vite`

* update `.gitignore`

* change `dev` npm script

* fix favicon href

* load `.env` files

* remove 'alias"

* add `preview`

* upgrade vite

* set `target`s in `vite.config.ts`

* upgrade `@vitejs/plugin-react`

* remove comment

* Update package.json

* Update vite.config.ts
2022-09-16 16:27:47 +02:00

33 lines
798 B
TypeScript

import react from '@vitejs/plugin-react'
import { defineConfig, loadEnv } from 'vite'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
},
},
build: {
target: 'es2020',
},
plugins: [react()],
define: {
/**
* Loads `.env` files and sets `process.env` varibales.
*
* @see https://vitejs.dev/config/#environment-variables
* @see https://vitejs.dev/config/shared-options.html#define
*/
...Object.entries(loadEnv(mode, process.cwd(), '')).reduce(
(variables, [key, value]) => ({
...variables,
[`process.env.${key}`]: `'${value}'`, // notice ''
}),
{}
),
},
}
})