Skip to content

Commit

Permalink
Minify CSS (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
akimon658 committed Nov 6, 2024
1 parent b9459da commit 0a6f963
Show file tree
Hide file tree
Showing 3 changed files with 448 additions and 2 deletions.
16 changes: 15 additions & 1 deletion _config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import robots from "lume/plugins/robots.ts"
import sitemap from "lume/plugins/sitemap.ts"
import tailwindcss from "lume/plugins/tailwindcss.ts"
import transformImages from "lume/plugins/transform_images.ts"
import cssnano from "cssnano"
import advancedPreset from "cssnano-preset-advanced"
import escapeHtml from "escape-html"
import type { Token } from "markdown-it"
import mila from "markdown-it-link-attributes"
import variableCompress from "postcss-variable-compress"
import rehypeExternalLinks from "rehype-external-links"
import rehypeRaw from "rehype-raw"
import typography from "@tailwindcss/typography"
Expand Down Expand Up @@ -196,7 +199,18 @@ site.use(tailwindcss({
},
},
}))
site.use(postcss())
site.use(postcss({
plugins: [
cssnano({
preset: advancedPreset({
discardComments: {
removeAll: true,
},
}),
}),
variableCompress,
],
}))
site.use(robots({
rules: [
{
Expand Down
3 changes: 3 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
"@tree-sitter-grammars/tree-sitter-lua": "npm:@tree-sitter-grammars/[email protected]",
"@tree-sitter-grammars/tree-sitter-markdown": "npm:@tree-sitter-grammars/[email protected]",
"@tree-sitter-grammars/tree-sitter-yaml": "npm:@tree-sitter-grammars/[email protected]",
"cssnano": "npm:[email protected]",
"cssnano-preset-advanced": "npm:[email protected]",
"escape-html": "npm:[email protected]",
"lume/": "https://deno.land/x/[email protected]/",
"markdown-it": "npm:[email protected]",
"markdown-it-link-attributes": "npm:[email protected]",
"postcss-variable-compress": "npm:[email protected]",
"rehype-external-links": "npm:[email protected]",
"rehype-raw": "npm:[email protected]",
"tree-sitter": "npm:[email protected]",
Expand Down
Loading

0 comments on commit 0a6f963

Please sign in to comment.