forked from vitejs/vite
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.js
35 lines (34 loc) · 876 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
import fs from 'node:fs'
import path from 'node:path'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
{
name: 'copy',
writeBundle() {
fs.mkdirSync(path.resolve(__dirname, 'dist/views'))
fs.mkdirSync(path.resolve(__dirname, 'dist/files'))
fs.copyFileSync(
path.resolve(__dirname, 'views/qux.js'),
path.resolve(__dirname, 'dist/views/qux.js'),
)
fs.copyFileSync(
path.resolve(__dirname, 'files/mxd.js'),
path.resolve(__dirname, 'dist/files/mxd.js'),
)
fs.copyFileSync(
path.resolve(__dirname, 'files/mxd.json'),
path.resolve(__dirname, 'dist/files/mxd.json'),
)
},
},
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'alias'),
},
},
build: {
sourcemap: true,
},
})