-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.js
38 lines (36 loc) · 944 Bytes
/
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
import liveReload from 'vite-plugin-live-reload'
import { resolve } from 'path'
const cwd = process.cwd()
// Docs: https://vitejs.dev/config/
export default ({ mode }) => ({
root: 'src',
base: mode === 'development' ? '/' : '/assets/',
resolve: {
alias: [
{ find: '@utils', replacement: resolve(cwd, 'src/js/utils') },
{ find: '@components', replacement: resolve(cwd, 'src/js/components') },
{ find: '@vendors', replacement: resolve(cwd, 'src/js/vendors') },
],
},
server: {
port: 3000,
strictPort: true,
cors: true,
},
build: {
target: 'es2017',
assetsDir: '.',
outDir: resolve(cwd, 'assets'),
rollupOptions: {
input: resolve(cwd, 'src/app.js'),
},
manifest: true,
emptyOutDir: true,
},
plugins: [
liveReload([
resolve(cwd, 'app/(templates|snippets|controllers|models)/**/*.php'),
resolve(cwd, 'storage/content/**/*'),
]),
],
})