I have started a new project with Vite, where I have the following project structure
the server folder is a node app, and the root folder is a react app, both use Vite, but this is the first time I'm using Vite, the doc seems really incomplete so I'm not sure if there is a better way of doing this, please let me know if you're aware of a better way of doing this.
└── project-name
├── index.html
├── package-lock.json
├── package.json
├── public
│ └── vite.svg
├── readme.md
├── server
│ ├── config.json
│ ├── constants
│ ├── deploy-commands.js
│ ├── features
│ │ └── interaction
│ │ └── index.js
│ ├── helpers
│ ├── index.js
│ ├── package-lock.json
│ ├── package.json
│ └── vite.config.js
├── src
│ ├── App.css
│ ├── App.jsx
│ ├── assets
│ │ └── react.svg
│ ├── index.css
│ └── main.jsx
└── vite.config.js
I tried this in the server/vite.config.js
export default defineConfig({
server: {
// vite server configs, for details see [vite doc](https://vitejs.dev/config/#server-host)
port: 7000,
// this doesnt work
// watch: {
// ignored: 'node_modules',
// },
},
plugins: [
...VitePluginNode({
adapter: 'express',
appPath: './index.js',
// Optional, default: 'viteNodeApp'
// the name of named export of you app from the appPath file
exportName: 'viteNodeApp',
swcOptions: {},
}),
],
optimizeDeps: {
// this also doesnt work
exclude: ['node_modules'],
},
});
I get hundreds of errors like this when I run vite
✘ [ERROR] Big integer literals are not available in the configured target environment ("chrome87", "edge88", "es2019", "firefox78", "safari13.1")
node_modules/discord.js/src/sharding/ShardClientUtil.js:245:44:
245 │ const shard = Number(BigInt(guildId) >> 22n) % shardCount;
╵