-
Notifications
You must be signed in to change notification settings - Fork 48
/
vite.config.ts
38 lines (36 loc) · 969 Bytes
/
vite.config.ts
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
// Copyright 2022-2024 use-ink/contracts-ui authors & contributors
// SPDX-License-Identifier: GPL-3.0-only
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import tsConfigPaths from 'vite-tsconfig-paths';
import istanbul from 'vite-plugin-istanbul';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
tsConfigPaths(),
istanbul({
include: 'src/*',
exclude: ['node_modules', 'cypress/'],
cypress: true,
}),
],
server: { host: '127.0.0.1', port: 8081 },
build: {
target: 'esnext',
rollupOptions: {
output: {
dir: './dist',
manualChunks(id) {
if (/[\\/]node_modules[\\/](react|react-dom)[\\/]/.test(id)) {
return 'react';
}
if (/[\\/]node_modules[\\/](@polkadot)[\\/]/.test(id)) {
return 'polkadot';
}
},
},
},
},
});