Skip to content

Commit 468537d

Browse files
committedFeb 11, 2025··
1 parent 269259b commit 468537d

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed
 

‎astro.config.ts

+48-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,48 @@ export default (await import("astro/config")).defineConfig({
3232
},
3333
vite: {
3434
build: {
35-
sourcemap: true,
35+
sourcemap: On,
36+
manifest: true,
37+
minify: On ? false : "terser",
38+
cssMinify: On ? false : "esbuild",
39+
terserOptions: On
40+
? {
41+
compress: false,
42+
ecma: 2020,
43+
enclose: false,
44+
format: {
45+
ascii_only: false,
46+
braces: false,
47+
comments: false,
48+
ie8: false,
49+
indent_level: 4,
50+
indent_start: 0,
51+
inline_script: false,
52+
keep_numbers: true,
53+
keep_quoted_props: true,
54+
max_line_len: 80,
55+
preamble: null,
56+
ecma: 5,
57+
preserve_annotations: true,
58+
quote_keys: false,
59+
quote_style: 3,
60+
safari10: true,
61+
semicolons: true,
62+
shebang: false,
63+
shorthand: false,
64+
webkit: true,
65+
wrap_func_args: true,
66+
wrap_iife: true,
67+
},
68+
sourceMap: true,
69+
ie8: true,
70+
keep_classnames: true,
71+
keep_fnames: true,
72+
mangle: false,
73+
module: true,
74+
toplevel: true,
75+
}
76+
: {},
3677
},
3778
resolve: {
3879
preserveSymlinks: true,
@@ -43,24 +84,24 @@ export default (await import("astro/config")).defineConfig({
4384
},
4485
plugins: [
4586
{
46-
name: "crossorigin",
87+
name: "CrossOrigin",
4788
transform(Code, Identifier, _) {
48-
const crossorigin = Identifier.includes(".js")
89+
const CrossOrigin = Identifier.includes(".js")
4990
? `crossorigin=\\"anonymous\\"`
5091
: 'crossorigin="anonymous"';
5192

52-
return Code.replace(/<script/g, `<script ${crossorigin}`)
93+
return Code.replace(/<script/g, `<script ${CrossOrigin}`)
5394
.replace(
5495
/<link[^>]*(?=.*rel="preload")(?=.*href="[^"]*\.js")(?=.*as="script")[^>]*/g,
55-
`$& ${crossorigin}`,
96+
`$& ${CrossOrigin}`,
5697
)
5798
.replace(
5899
/<link[^>]*(?=.*rel="preload")(?=.*as="font")[^>]*/g,
59-
`$& ${crossorigin}`,
100+
`$& ${CrossOrigin}`,
60101
)
61102
.replace(
62103
/<link[^>]*(?=.*rel="stylesheet")(?=.*href="https?:\/\/[^"]*")[^>]*/g,
63-
`$& ${crossorigin}`,
104+
`$& ${CrossOrigin}`,
64105
);
65106
},
66107
},

‎tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { fontFamily } from "tailwindcss/defaultTheme";
22

3+
/** @type {import('tailwindcss').Config} */
34
export default {
45
content: [
56
"./Public/**/*.html",

0 commit comments

Comments
 (0)
Please sign in to comment.