generated from TryGhost/Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
54 lines (53 loc) · 1.05 KB
/
vite.config.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { defineConfig } from 'vite'
import { resolve } from 'path';
import legacy from '@vitejs/plugin-legacy';
import vue from '@vitejs/plugin-vue'
import babel from 'vite-plugin-babel';
import liveReload from 'vite-plugin-live-reload';
import { viteStaticCopy } from 'vite-plugin-static-copy';
const fs = require('fs');
export default defineConfig({
root: './',
base: './',
publicDir: './assets/build',
server: {
// required to load scripts from custom host
cors: true,
strictPort: true,
port: 3000,
hmr: {
port: 3000,
host: 'localhost',
protocol: 'ws',
},
},
build: {
outDir: resolve(__dirname, './'),
emptyOutDir: false,
manifest: true,
},
resolve: {
alias: {
'@': './assets/js'
}
},
plugins: [
babel(),
vue(),
legacy({
targets: ['defaults']
}),
// viteStaticCopy({
// targets: [
// {
// src: './assets/svg',
// dest: '../'
// }
// ]
// }),
liveReload([
`**/*\.hbs`,
`**/*\.html`
]),
]
});