forked from LNReader/lnreader-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
40 lines (38 loc) · 1.29 KB
/
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
39
40
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import path from 'path';
import { fileURLToPath } from 'url';
import { proxyHandlerMiddle, proxySettingMiddleware } from './proxy';
const dirname = path.dirname(fileURLToPath(import.meta.url));
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
nodePolyfills(),
react({ devTarget: 'es5' }),
{
name: 'proxy',
configureServer: server => {
server.middlewares.use('/settings', proxySettingMiddleware);
server.middlewares.use('/https:', proxyHandlerMiddle);
},
},
],
resolve: {
alias: {
'@libs': path.resolve(dirname, './src/libs'),
'@icons': path.resolve(dirname, './src/icons'),
'@components': path.resolve(dirname, './src/components'),
'@redux': path.resolve(dirname, './src/redux'),
'@provider': path.resolve(dirname, './src/provider'),
'@plugins': path.resolve(dirname, './src/plugins'),
'@hooks': path.resolve(dirname, './src/hooks'),
'@typings': path.resolve(dirname, './src/types'),
'@scripts': path.resolve(dirname, './scripts'),
'@store': path.resolve(dirname, './src/store'),
},
},
server: {
port: 3000,
},
});