From 6ed5ebd304f4ac1abf3c5447cf37e02e01d73644 Mon Sep 17 00:00:00 2001 From: Erick Ruiz de Chavez Date: Fri, 29 Apr 2022 17:45:37 -0400 Subject: [PATCH] Add a build script --- build.sh | 11 +++++++++++ package.json | 8 ++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..75703d1 --- /dev/null +++ b/build.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +rm -rf dist && mkdir dist + +npx tailwindcss -i tailwind.css -o dist/styles.css --minify + +hash=$(shasum dist/styles.css | awk '{print $1}') +new_file="styles.$hash.css" +mv dist/styles.css dist/$new_file + +sed "s/styles\.css/$new_file/" index.html > dist/index.html diff --git a/package.json b/package.json index 78abfbe..4368144 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,8 @@ "version": "1.0.0", "description": "", "scripts": { - "browserslist": "npx browserslist@latest --update-db -y", - "build": "npm run clean && npm run browserslist && npm run tailwind && npm run copy", - "clean": "rm -rf dist && mkdir dist", - "copy": "cp index.html dist/", "start": "tailwindcss -i tailwind.css -o styles.css -m --watch", - "tailwind": "tailwindcss -i tailwind.css -o dist/styles.css --minify" + "build": "./build.sh" }, "repository": { "type": "git", @@ -20,7 +16,7 @@ "bugs": { "url": "https://github.com/eruizdechavez/sinsaludar.com/issues" }, - "homepage": "https://sinsaludar.com", + "homepage": "https://www.sinsaludar.com", "devDependencies": { "tailwindcss": "^2.2.15" }