-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.js
46 lines (45 loc) · 1.33 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
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import laravel from 'laravel-vite-plugin';
import inject from "@rollup/plugin-inject"
export default defineConfig({
plugins: [
inject({ // => that should be first under plugins array
$: 'jquery',
jQuery: 'jquery',
moment: 'moment',
}),
splitVendorChunkPlugin(),
laravel({
input: [
'resources/sass/app.scss',
'resources/sass/tinymce.scss',
'resources/js/app.js',
'resources/js/tinymce.js',
],
refresh: true,
}),
],
build: {
rollupOptions: {
output: {
manualChunks(id) {
// creating a chunk to @open-ish deps. Reducing the vendor chunk size
if (id.includes('admin-lte') || id.includes('bootstrap')) {
return 'admin-lte';
}
// creating a chunk to react routes deps. Reducing the vendor chunk size
if (
id.includes('tinymce')
) {
return 'tinymce';
}
if (
id.includes('datatables')
) {
return 'datatables';
}
},
},
},
}
});