Passed
Push — develop ( 2a011e...787813 )
by Andrew
09:46 queued 01:51
created

buildchain/vite.config.js   A

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 54
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 38
c 0
b 0
f 0
dl 0
loc 54
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
        'imageoptimize': 'src/js/ImageOptimize.js',
16
        'field': 'src/js/OptimizedImagesField.js',
17
        'welcome': 'src/js/Welcome.js',
18
      },
19
      output: {
20
        sourcemap: true
21
      },
22
    }
23
  },
24
  plugins: [
25
    nodeResolve({
26
      moduleDirectories: [
27
         path.resolve('./node_modules'),
28
      ],
29
    }),
30
    ViteRestart({
31
      reload: [
32
          './src/templates/**/*',
33
      ],
34
    }),
35
    createVuePlugin(),
36
  ],
37
  publicDir: '../src/web/assets/public',
38
  resolve: {
39
    alias: {
40
      '@': path.resolve(__dirname, './src'),
41
      'vue': 'vue/dist/vue.esm.js',
42
    },
43
    preserveSymlinks: true,
44
  },
45
  server: {
46
    fs: {
47
      strict: false
48
    },
49
    host: '0.0.0.0',
50
    origin: 'http://localhost:3001/',
51
    port: 3001,
52
    strictPort: true,
53
  }
54
});
55