forked from AirboZH/halo-theme-chirpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
44 lines (42 loc) · 1.03 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
import {defineConfig} from 'vite';
import {fileURLToPath} from 'url';
import inject from '@rollup/plugin-inject';
import path from 'path';
export default defineConfig({
root: 'src',
base: '/themes/halo-theme-chirpy/assets/dist/',
build: {
outDir: fileURLToPath(new URL('./templates/assets/dist/', import.meta.url)),
emptyOutDir: true,
minify: true,
cssMinify: true,
rollupOptions: {
input: path.resolve(__dirname, 'src/main.js'),
output: {
entryFileNames: `[name].js`,
assetFileNames: '[name][extname]',
chunkFileNames: `[name].[hash].js`,
manualChunks: {
bootstrap: ['bootstrap'],
jquery: ['jquery'],
magnific_popup: ['magnific-popup'],
tocbot: ['tocbot'],
}
}
},
sourcemap: true
},
plugins: [
inject({
$: 'jquery',
jQuery: 'jquery',
bootstrap: ['bootstrap', '*']
})
],
optimizeDeps: {
include: ['jquery', 'bootstrap']
},
server: {
origin: 'http://localhost:5173'
}
});