Passed
Push — v3 ( e860f3...8a1456 )
by Andrew
43:58 queued 20:59
created

buildchain/vite.config.js   A

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 56
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 40
c 0
b 0
f 0
dl 0
loc 56
rs 10
mnd 1
bc 1
fnc 1
bpm 1
cpm 2
noi 0
1
import { createVuePlugin } from 'vite-plugin-vue2'
2
import ViteRestart from 'vite-plugin-restart';
3
import { nodeResolve } from '@rollup/plugin-node-resolve';
4
import path from 'path';
5
6
// https://vitejs.dev/config/
7
export default ({ command }) => ({
8
  base: command === 'serve' ? '' : '/dist/',
9
  build: {
10
    emptyOutDir: true,
11
    manifest: true,
12
    outDir: '../src/web/assets/dist',
13
    rollupOptions: {
14
      input: {
15
        'dashboard': './src/js/Dashboard.js',
16
        'import': './src/js/Import.js',
17
        'redirects': './src/js/Redirects.js',
18
        'retour': './src/js/Retour.js',
19
        'widget': './src/js/Widget.js'
20
      },
21
      output: {
22
        sourcemap: true
23
      },
24
    }
25
  },
26
  plugins: [
27
    nodeResolve({
28
      moduleDirectories: [
29
         path.resolve('./node_modules'),
30
      ],
31
    }),
32
    ViteRestart({
33
      reload: [
34
          './src/templates/**/*',
35
      ],
36
    }),
37
    createVuePlugin(),
38
  ],
39
  publicDir: '../src/web/assets/public',
40
  resolve: {
41
    alias: {
42
      '@': path.resolve(__dirname, './src'),
43
      'vue': 'vue/dist/vue.esm.js',
44
    },
45
    preserveSymlinks: true,
46
  },
47
  server: {
48
    fs: {
49
      strict: false
50
    },
51
    host: '0.0.0.0',
52
    origin: 'http://localhost:3001/',
53
    port: 3001,
54
    strictPort: true,
55
  }
56
});
57