You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/ko/reference/experimental-flags/svg-optimization.mdx
+55-18Lines changed: 55 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,17 +48,22 @@ SVG는 빌드 과정에서 최적화되어 프로덕션 빌드 시 파일 크기
48
48
49
49
## 구성
50
50
51
-
최적화 동작을 사용자 정의하기 위해 [SVGO 구성 객체](https://github.com/svg/svgo/blob/66d503a48c6c95661726262a3068053c429b06a9/lib/types.ts#L335)를 전달할 수 있습니다.
51
+
최적화 동작을 사용자 정의하기 위해 [SVGO 구성 객체](https://github.com/svg/svgo#configuration)를 전달할 수 있습니다.
52
52
53
53
```js title="astro.config.mjs"
54
54
exportdefaultdefineConfig({
55
55
experimental: {
56
56
svgo: {
57
+
multipass:true,
58
+
floatPrecision:2,
57
59
plugins: [
58
60
'preset-default',
61
+
'removeXMLNS',
59
62
{
60
-
name:'removeViewBox',
61
-
active:false
63
+
name:"removeXlink",
64
+
params: {
65
+
includeLegacy:true
66
+
}
62
67
}
63
68
]
64
69
}
@@ -73,17 +78,34 @@ export default defineConfig({
73
78
74
79
SVG 컴포넌트 가져오기를 최적화하는 데 사용될 [SVGO 플러그인](https://svgo.dev/docs/plugins/)의 배열입니다.
75
80
76
-
이는 SVGO의 `preset-default` 플러그인 모음을 포함하여 ID 이름으로 모든 플러그인을 포함할 수 있습니다. 플러그인은 필요에 따라 활성화하거나 비활성화하기 위해 `name`과 `active` 상태를 모두 포함하는 객체로 전달될 수도 있습니다.
81
+
여기에는 SVGO의 [`preset-default`](https://svgo.dev/docs/preset-default/) 플러그인 컬렉션, 개별 내장 플러그인 또는 [커스텀 플러그인](https://svgo.dev/docs/plugins-api/)이 포함될 수 있습니다.
82
+
83
+
플러그인의 기본 구성을 사용하려면 배열에 이름을 추가하세요. 더 세밀하게 제어하려면 `overrides` 매개변수를 사용하여 `preset-default` 내의 특정 플러그인을 사용자 정의하거나, 플러그인의 `name`이 포함된 객체를 전달하여 개별 매개변수를 재정의하세요.
[다른 SVGO 구성 옵션](https://github.com/svg/svgo/blob/66d503a48c6c95661726262a3068053c429b06a9/lib/types.ts#L335)(예: `floatPrecision` 및 `multipass`)을 구성 객체에 직접 전달할 수도 있습니다.
118
+
특히 `floatPrecision` 및 `multipass`를 비롯하여 구성 객체에 직접 전달할 수 있는 몇 가지 [SVGO 구성 옵션](https://github.com/svg/svgo/blob/66d503a48c6c95661726262a3068053c429b06a9/lib/types.ts#L335)이 있습니다.
97
119
98
120
```js title="astro.config.mjs"
99
121
exportdefaultdefineConfig({
100
122
experimental: {
101
123
svgo: {
102
-
floatPrecision:2,
103
-
multipass:true
124
+
multipass:true,
125
+
floatPrecision:2
104
126
}
105
127
}
106
128
})
107
129
```
108
130
131
+
`multipass` 옵션은 더 이상 최적화할 수 없을 때까지 최적화 엔진을 여러 번 실행할지 여부를 설정합니다. `floatPrecision` 옵션은 전역적으로 유지할 소수점 자릿수를 설정하지만, 플러그인의 `params` 속성에 사용자 정의 값을 지정하여 특정 플러그인에 대해 재정의할 수 있습니다.
132
+
109
133
## 일반적인 사용 사례
110
134
111
-
SVGO는 각 플러그인을 개별적으로 추가하는 것보다 더 편리한 최적화가 포함된 다양한[기본 플러그인 목록](https://svgo.dev/docs/preset-default/)을 제공합니다. 하지만 필요에 따라 더 구체적으로 사용자 정의해야 할 수도 있습니다. 예를 들어, 특정 항목을 제거하거나 상황에 따라 더 적극적으로 정리할 수 있습니다.
135
+
SVGO는 권장되는 최적화가 포함된 광범위한[기본 플러그인 목록](https://svgo.dev/docs/preset-default/)을 제공합니다. 이 프리셋을 사용하는 것이 각 플러그인을 개별적으로 추가하는 것보다 편리하지만, 추가적인 사용자 정의가 필요할 수 있습니다. 예를 들어, 특히 애니메이션을 사용하는 경우 상황에 따라 항목을 매우 공격적으로 제거하거나 정리할 수 있습니다.
112
136
113
137
### 특정 속성 유지하기
114
138
115
-
SVGO가 기본적으로 제거하는 `viewBox`와 같은 특정 SVG 속성을 유지하고 싶을 수도 있습니다.
139
+
SVGO가 기본적으로 인라인화하거나 제거하는 `<style>`과 같은 특정 SVG 속성 및 요소를 유지하고 싶을 수 있습니다.
0 commit comments