Skip to content

Commit 713db2a

Browse files
committed
New build script
1 parent 6c0cc28 commit 713db2a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

build-js.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
echo "$(tput setaf 3)Building JS Files$(tput sgr0)"
4+
5+
# Find all .js files in ./assets and ./assets/js, excluding those ending with .min.js
6+
find ./assets ./assets/js -type f -name '*.js' ! -name '*.min.js' | while read -r f; do
7+
file=${f%.js}
8+
echo "$(tput setaf 3)Building $f$(tput sgr0)"
9+
node_modules/.bin/uglifyjs "$f" -c -m -o "$file.min.js"
10+
done

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"archive": "rm -rf $npm_package_name && composer archive --file=$npm_package_name --format=zip",
3838
"postarchive": "rm -rf $npm_package_name && unzip $npm_package_name.zip -d $npm_package_name && rm $npm_package_name.zip && zip -r $npm_package_name.zip $npm_package_name && rm -rf $npm_package_name",
3939
"prebuild:js": "rm -f $npm_package_assets_js_min",
40-
"build:js": "echo \"$(tput setaf \"3\")Building JS Files$(tput sgr0)\"; for f in $npm_package_assets_js_src; do file=${f%.js}; echo \"$(tput setaf \"3\")Building $f$(tput sgr0)\"; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done",
40+
"build:js": "./build-js.sh",
4141
"prebuild:css": "rm -f $npm_package_assets_css_min",
4242
"build:css": "echo \"$(tput setaf \"3\")Building CSS Files$(tput sgr0)\"; sass -I node_modules/bourbon/core -I node_modules/susy/sass assets/css:assets/css --style compressed --no-source-map && sass -I node_modules/bourbon/core -I node_modules/susy/sass style.scss:style.css --style compressed --no-source-map",
4343
"postbuild:css": "npm run autoprefixer && npm run rtlcss",

0 commit comments

Comments
 (0)