-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathvite.config.js
More file actions
34 lines (32 loc) · 991 Bytes
/
vite.config.js
File metadata and controls
34 lines (32 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const path = require('path');
const VitePluginReact = require('vite-plugin-react');
const viteConfig = ({ ...rest }) => ({
root: path.join(__dirname, 'client'),
alias: {
'react': '@pika/react',
'react-dom': '@pika/react-dom',
'auto-bind': 'auto-bind/index',
'crypto': 'crypto-browserify',
'http': 'http-browserify',
'https': 'https-browserify',
'stream': 'stream-browserify',
},
jsx: 'react',
optimizeDeps: {
include: ['auto-bind/index', 'stylis-rule-sheet'],
},
// Explictly don't add the plugin resolvers because
// we want prod React to make warnings go away
// resolvers: [...VitePluginReact.resolvers],
configureServer: [VitePluginReact.configureServer],
transforms: [...VitePluginReact.transforms],
...rest
});
// Only for build
module.exports = viteConfig({
outDir: path.join(__dirname, 'dist'),
rollupInputOptions: {
external: ['/primus/primus.js', '/snarkjs.min.js']
},
});
module.exports.viteConfig = viteConfig;