Skip to content

Commit 9c2f097

Browse files
committed
fresh
1 parent 531dfac commit 9c2f097

File tree

3 files changed

+157
-43
lines changed

3 files changed

+157
-43
lines changed

package-lock.json

Lines changed: 135 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"license": "MIT",
1313
"main": "src/init.js",
1414
"scripts": {
15+
"serve": "vue-cli-service serve",
1516
"dev": "vite",
1617
"build": "vite build",
1718
"preview": "vite preview"
@@ -36,6 +37,7 @@
3637
"eslint-plugin-vue": "^9.2.0",
3738
"prettier": "^2.5.1",
3839
"sass": "^1.49.7",
39-
"vite": "^3.0.0"
40+
"vite": "^3.0.0",
41+
"vite-plugin-compression": "^0.5.1"
4042
}
4143
}

vite.config.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
import { defineConfig } from 'vite';
22
import vue from '@vitejs/plugin-vue';
3+
import _ from 'lodash'; // Membawa seluruh library lodash (besar)
4+
import debounce from 'lodash/debounce'; // Hanya membawa fungsi debounce (lebih kecil)
5+
import viteCompression from 'vite-plugin-compression';
36

4-
// https://vitejs.dev/config/
57
export default defineConfig({
6-
plugins: [vue()],
8+
plugins: [
9+
vue(),
10+
viteCompression({ algorithm: 'gzip' }), // atau 'brotliCompress' untuk Brotli compression
11+
],
712
build: {
8-
minify: true,
9-
cssCodeSplit: false,
1013
rollupOptions: {
1114
output: {
12-
manualChunks: {
13-
vendor: [],
15+
manualChunks(id) {
16+
if (id.includes('node_modules')) {
17+
return 'vendor';
18+
}
1419
},
1520
},
1621
},
1722
},
1823

19-
css: { preprocessorOptions: { scss: { charset: false } } },
24+
25+
css: {
26+
preprocessorOptions: {
27+
scss: {
28+
charset: false // Menghilangkan charset dari file SCSS
29+
}
30+
}
31+
},
2032
});

0 commit comments

Comments
 (0)