Add a build script
This commit is contained in:
parent
bb6940b834
commit
6ed5ebd304
2 changed files with 13 additions and 6 deletions
11
build.sh
Executable file
11
build.sh
Executable file
|
@ -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
|
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue