aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/functions/resources/Minify.md
blob: 9749df20a4c79f6212cae28e5e69d92a6d08c209 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
title: resources.Minify
description: Minifies the given resource.
categories: []
keywords: []
action:
  aliases: [minify]
  related:
    - functions/js/Build
    - functions/resources/Babel
    - functions/resources/Fingerprint
    - functions/resources/PostCSS
    - functions/resources/ToCSS
  returnType: resource.Resource
  signatures: [resources.Minify RESOURCE]
---

```go-html-template
{{ $css := resources.Get "css/main.css" }}
{{ $style := $css | minify }}
```

Any CSS, JS, JSON, HTML, SVG, or XML resource can be minified using resources.Minify which takes for argument the resource object.