forked from larry-xue/astro-sassify-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
60 lines (59 loc) · 1.53 KB
/
astro.config.mjs
File metadata and controls
60 lines (59 loc) · 1.53 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { defineConfig } from 'astro/config';
import alpinejs from '@astrojs/alpinejs';
import react from '@astrojs/react';
import tailwind from '@astrojs/tailwind';
export default defineConfig({
site: 'https://impactorbit.co',
base: '/',
integrations: [
alpinejs(),
react({ fastRefresh: true }),
tailwind({ config: { applyBaseStyles: true } }),
],
vite: {
server: {
fs: { strict: false },
},
build: {
target: 'esnext',
minify: 'esbuild',
chunkSizeWarningLimit: 500, // warn only for large chunks
rollupOptions: {
external: ['gray-matter', 'node-fetch'],
output: {
manualChunks(id) {
if (id.includes('EarthGlobe')) return 'chunk_earthglobe';
if (id.includes('SearchableLibrary')) return 'chunk_searchablelibrary';
if (id.includes('node_modules')) return 'vendor';
},
},
},
},
resolve: {
alias: {
'@components': '/src/components',
'@layouts': '/src/layouts',
'@styles': '/src/styles',
'@data': '/src/data',
'@assets': '/src/assets',
},
},
optimizeDeps: {
include: ['react', 'react-dom'],
exclude: ['lightningcss', 'fsevents', 'gray-matter', 'node-fetch'],
esbuildOptions: {
loader: {
'.ts': 'ts',
'.tsx': 'tsx',
'.js': 'js',
'.jsx': 'jsx',
},
},
},
esbuild: {
loader: 'tsx',
include: /src\/.*\.(ts|tsx|js|jsx|astro)$/,
exclude: [],
},
},
});