Skip to content

Commit 6ed3565

Browse files
committed
Adding compression algorithm
Implemented a compression algorithm where any data type or file can be compressed without quality loss with minimal file size. Signed-off-by: Abdon Morales <abdonm@cs.utexas.edu>
1 parent 175c46d commit 6ed3565

16 files changed

Lines changed: 3190 additions & 26 deletions

astro.config.mjs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,34 @@ export default defineConfig({
66
output: 'static',
77
build: {
88
assets: 'assets',
9-
inlineStylesheets: 'auto'
9+
inlineStylesheets: 'auto',
10+
assetsPrefix: '/'
1011
},
1112
image: {
1213
service: {
1314
entrypoint: 'astro/assets/services/sharp'
14-
}
15+
},
16+
domains: ['abdonmorales.github.io']
17+
},
18+
prefetch: {
19+
prefetchAll: true,
20+
defaultStrategy: 'viewport'
1521
},
1622
compressHTML: true,
17-
integrations: [react()]
23+
integrations: [react()],
24+
vite: {
25+
build: {
26+
cssCodeSplit: true,
27+
rollupOptions: {
28+
output: {
29+
manualChunks: {
30+
'react-vendor': ['react', 'react-dom']
31+
}
32+
}
33+
}
34+
},
35+
ssr: {
36+
noExternal: ['@astrojs/react']
37+
}
38+
}
1839
});

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"lint": "npm run lint:ts",
1313
"dev": "astro dev",
1414
"start": "astro dev",
15-
"build": "astro build",
15+
"build": "astro build && node scripts/compress-assets.mjs",
16+
"build:no-compress": "astro build",
17+
"compress": "node scripts/compress-assets.mjs",
1618
"preview": "astro preview",
1719
"astro": "astro"
1820
},

0 commit comments

Comments
 (0)