diff --git a/.eleventy.js b/.eleventy.js index 972fa38..05fea6e 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,12 +1,10 @@ +const pluginRev = require("eleventy-plugin-rev"); const eleventySass = require("eleventy-sass"); -const tinyCSS = require('@sardine/eleventy-plugin-tinycss'); const tinyHTML = require('@sardine/eleventy-plugin-tinyhtml'); const site = require('./src/_data/site.js'); module.exports = function (eleventyConfig) { - eleventyConfig.addPlugin(tinyCSS, { - output: `dist/${site.lang}/` - }); + eleventyConfig.addPlugin(pluginRev); eleventyConfig.addPlugin(tinyHTML); eleventyConfig.addPlugin(eleventySass, { sass: { @@ -20,7 +18,8 @@ module.exports = function (eleventyConfig) { return data.page.filePathStem.replace(/^\/scss\//, "/css/") + ".css"; }; } - } + }, + rev: true }); eleventyConfig.setUseGitIgnore(false); diff --git a/package.json b/package.json index 130e4a4..95c1fc5 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,12 @@ "version": "1.0.0", "description": "Website for samuel-philipp.de", "scripts": { + "minify-css": "uncss -n -H dist/en/ -o dist/en/css/main-*.css dist/en/index.html", + "minify-css:de": "uncss -n -H dist/de/ -o dist/de/css/main-*.css dist/de/index.html", "start": "eleventy --serve --watch", "start:de": "LANGUAGE=de eleventy --serve --watch", - "build": "npm run compile-sass && eleventy && npm run minify-css && node .compress-all.js", - "build:de": "npm run compile-sass && eleventy && npm run minify-css && node .compress-all.js --lang de" + "build": "eleventy && npm run minify-css", + "build:de": "LANGUAGE=de eleventy && npm run minify-css" }, "author": "samuel-p", "repository": { @@ -22,18 +24,17 @@ "@node-minify/core": "^7.1.0", "@node-minify/crass": "^7.1.0", "@node-minify/html-minifier": "^7.1.0", - "@sardine/eleventy-plugin-tinycss": "^2.0.0", + "@sardine/eleventy-plugin-tinyhtml": "^0.2.0", "cpx": "^1.5.0", + "eleventy-plugin-rev": "^1.0.2", "eleventy-sass": "^2.1.6", "glob": "^8.0.3", "minify": "^9.1.0", - "node-sass": "^8.0.0", - "node-sass-tilde-importer": "^1.0.2", "postcss": "^8.4.21", - "sass": "^1.57.1" + "sass": "^1.57.1", + "uncss": "^0.17.3" }, "dependencies": { - "@sardine/eleventy-plugin-tinyhtml": "^0.2.0", "bootstrap": "^5.2.3" } } diff --git a/src/index.html b/src/index.html index c417cb6..f71de39 100644 --- a/src/index.html +++ b/src/index.html @@ -33,7 +33,7 @@ title: {{site.title}} - +