-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
62 lines (58 loc) · 1.48 KB
/
vite.config.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { sveltekit } from '@sveltejs/kit/vite';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import path from 'path';
/** @type {() => import('vite').UserConfig} */
const config = ({ mode }) => {
const development = mode === 'development';
return {
plugins: [
sveltekit(),
development &&
nodePolyfills({
include: ['node_modules/**/*.js', new RegExp('node_modules/.vite/.*js')],
http: true,
crypto: true
})
],
resolve: {
alias: {
$stores: path.resolve('./src/stores'),
$utils: path.resolve('./src/utils'),
$assets: path.resolve('./src/assets'),
$constants: path.resolve('./src/constants'),
$models: path.resolve('./src/models'),
$data: path.resolve('./src/data'),
$juicebox: path.resolve('./src/juicebox'),
$components: path.resolve('./src/components'),
$markdown: path.resolve('./src/markdown'),
$tiles: path.resolve('./src/tiles'),
$deployments: path.resolve('./src/deployments'),
crypto: 'crypto-browserify',
stream: 'stream-browserify',
assert: 'assert',
util: path.resolve('./libraries/util')
}
},
ssr: {
noExternal: ['@lingui/*', 'lingui-core/*']
},
optimizeDeps: {
esbuildOptions: { target: 'es2020', supported: { bigint: true } }
},
build: {
target: ['es2020'],
rollupOptions: {
plugins: [
nodePolyfills({
crypto: true,
http: true
})
]
},
commonjsOptions: {
transformMixedEsModules: true
}
}
};
};
export default config;