Skip to content

Commit

Permalink
Add build zip script and update build process in package.json
Browse files Browse the repository at this point in the history
Introduced the build-zip.sh script to automate zip file creation for distribution. Updated package.json to execute 'build:zip' as part of the build process. Also added a 'clean' script to clear temporary and distribution directories prior to build.
  • Loading branch information
reatlat committed Mar 3, 2024
1 parent 3d9b100 commit 64bcb0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
"description": "Hubspot CMS theme boilerplate with TailwindCSS, AlpineJS, and more.",
"main": "index.js",
"scripts": {
"clean": "rimraf './_temp' './_dist' && mkdir './_temp' './_dist'",
"fetch:hubspot": "hs fetch --overwrite /FreshJuice ./theme && ./scripts/post-fetch.sh",
"upload:hubspot": "hs upload ./theme /FreshJuice",
"watch:hubspot": "hs watch ./theme /FreshJuice",
"watch:tailwind": "npx tailwindcss --postcss -i ./source/css/tailwind.css -o ./theme/css/tailwind.css --watch",
"build:tailwind": "npx tailwindcss --postcss -i ./source/css/tailwind.css -o ./theme/css/tailwind.css",
"watch:js": "esbuild ./source/js/main.js --outfile=./theme/js/main.js --bundle --watch",
"build:js": "esbuild ./source/js/main.js --outfile=./theme/js/main.js --bundle",
"build:zip": "./scripts/build-zip.sh",
"start": "npm-run-all --parallel watch:*",
"build": "npm-run-all build:*",
"build": "npm-run-all --serial clean build:js build:tailwind build:zip",
"prepare": "husky install"
},
"repository": {
Expand Down
9 changes: 9 additions & 0 deletions scripts/build-zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

mkdir -p ./_temp/FreshJuice ./_dist

cp -r ./theme/* ./_temp/FreshJuice

cd ./_temp

zip -rm ../_dist/freshjuice-hubspot-theme.zip ./FreshJuice -x "*/.DS_Store"

0 comments on commit 64bcb0e

Please sign in to comment.