-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.ts
99 lines (92 loc) · 2.55 KB
/
astro.config.ts
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { babel } from '@rollup/plugin-babel'
import { defineConfig } from 'astro/config'
import compress from 'astro-compress'
import purgecss from 'astro-purgecss'
import robotsTxt from 'astro-robots-txt'
import tsconfigPaths from 'vite-tsconfig-paths'
import type { Logger } from 'sass'
const production = process.env.NODE_ENV === 'production'
const silenceSomeSassDeprecationWarnings = {
verbose: true,
logger: {
warn(message, options) {
const { stderr } = process;
const span = options.span ?? undefined;
const stack = (options.stack === 'null' ? undefined : options.stack) ?? undefined;
if (options.deprecation) {
if (message.startsWith('Sass\'s behavior for declarations that appear after nested')) {
// silences above deprecation warning
return;
}
stderr.write('DEPRECATION ');
}
stderr.write(`WARNING: ${message}\n`);
if (span !== undefined) {
// output the snippet that is causing this warning
stderr.write(`\n"${span.text}"\n`);
}
if (stack !== undefined) {
// indent each line of the stack
stderr.write(` ${stack.toString().trimEnd().replace(/\n/gm, '\n ')}\n`);
}
stderr.write('\n');
}
} satisfies Logger
}
export default defineConfig({
integrations: [
robotsTxt({
sitemap: false,
}),
production
? purgecss({
safelist: ['iframe'],
})
: [],
production ? compress() : [],
],
site: 'https://raz-poebuilds.netlify.app',
vite: {
plugins: [tsconfigPaths()],
optimizeDeps: {
exclude: ['@resvg'],
},
css: {
preprocessorOptions: {
scss: {
...silenceSomeSassDeprecationWarnings,
quietDeps: true,
},
},
},
build: {
rollupOptions: {
plugins: [
production
? babel({
babelHelpers: 'bundled',
extensions: ['.js', '.ts'],
presets: [
[
'@babel/preset-env',
{
debug: false,
modules: 'auto',
useBuiltIns: 'usage',
bugfixes: true,
corejs: {
version: '3.39.0',
proposals: true,
},
},
],
],
exclude: [/\/core-js\//u, 'node_modules/**'],
})
: [],
],
},
},
},
output: 'static',
})