Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 70 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {defineConfig} from 'vite'; |
||
2 | import vue from '@vitejs/plugin-vue' |
||
3 | import ViteRestart from 'vite-plugin-restart'; |
||
4 | import viteCompression from 'vite-plugin-compression'; |
||
5 | import manifestSRI from 'vite-plugin-manifest-sri'; |
||
6 | import {visualizer} from 'rollup-plugin-visualizer'; |
||
7 | import eslintPlugin from 'vite-plugin-eslint'; |
||
8 | import {nodeResolve} from '@rollup/plugin-node-resolve'; |
||
9 | import * as path from 'path'; |
||
10 | |||
11 | // https://vitejs.dev/config/ |
||
12 | export default defineConfig(({command}) => ({ |
||
13 | base: command === 'serve' ? '' : '/dist/', |
||
14 | build: { |
||
15 | emptyOutDir: true, |
||
16 | manifest: true, |
||
17 | outDir: '../src/web/assets/dist', |
||
18 | rollupOptions: { |
||
19 | input: { |
||
20 | app: 'src/js/app.ts', |
||
21 | welcome: 'src/js/welcome.ts', |
||
22 | }, |
||
23 | output: { |
||
24 | sourcemap: true |
||
25 | }, |
||
26 | } |
||
27 | }, |
||
28 | plugins: [ |
||
29 | nodeResolve({ |
||
30 | moduleDirectories: [ |
||
31 | path.resolve('./node_modules'), |
||
32 | ], |
||
33 | }), |
||
34 | ViteRestart({ |
||
35 | reload: [ |
||
36 | './src/templates/**/*', |
||
37 | ], |
||
38 | }), |
||
39 | vue(), |
||
40 | viteCompression({ |
||
41 | filter: /\.(js|mjs|json|css|map)$/i |
||
42 | }), |
||
43 | manifestSRI(), |
||
44 | visualizer({ |
||
45 | filename: '../src/web/assets/dist/stats.html', |
||
46 | template: 'treemap', |
||
47 | sourcemap: true, |
||
48 | }), |
||
49 | eslintPlugin({ |
||
50 | cache: false, |
||
51 | }), |
||
52 | ], |
||
53 | publicDir: '../src/web/assets/public', |
||
54 | resolve: { |
||
55 | alias: { |
||
56 | '@': path.resolve(__dirname, './src') |
||
57 | }, |
||
58 | preserveSymlinks: true, |
||
59 | }, |
||
60 | server: { |
||
61 | fs: { |
||
62 | strict: false |
||
63 | }, |
||
64 | host: '0.0.0.0', |
||
65 | origin: 'http://localhost:3001/', |
||
66 | port: 3001, |
||
67 | strictPort: true, |
||
68 | } |
||
69 | })); |
||
70 |