| 1 |
# Debian doesn't have most of the gulp plugins that upstream uses |
| 2 |
# so instead do the work "manually" |
| 3 |
# inspired by Julian Gilbey <[email protected]> |
| 4 |
# https://salsa.debian.org/jdg/nbdime/-/commit/678a8b1d2aee621a5e20ac7fa119975dcde5d64e |
| 5 |
|
| 6 |
mkdir -p dist/js dist/css |
| 7 |
|
| 8 |
# Build & minify the css |
| 9 |
rsass src/sass/alertify.scss > src/sass/alertify.css |
| 10 |
postcss --config debian src/sass/alertify.css --dir src/css |
| 11 |
cssmin < src/css/alertify.css > dist/css/alertify.css |
| 12 |
|
| 13 |
# insert contents of alertify.css at the proper marker in the alertify js |
| 14 |
# and then minify it |
| 15 |
perl -MFile::Slurp -e ' |
| 16 |
my $js = read_file("src/js/alertify.js"); |
| 17 |
my $css = read_file("dist/css/alertify.css"); |
| 18 |
$js =~ s%\Q/* style\.css */\E%$css%; |
| 19 |
print $js; |
| 20 |
' | uglifyjs > dist/js/alertify.js |
| 21 |
|
| 22 |
# insert contents of alertify.css and alertify.js at the proper markers |
| 23 |
# in the alertify angular js and then minify it |
| 24 |
perl -MFile::Slurp -e ' |
| 25 |
my $angularjs = read_file("src/js/ngAlertify.js"); |
| 26 |
my $js = read_file("src/js/alertify.js"); |
| 27 |
my $css = read_file("dist/css/alertify.css"); |
| 28 |
$angularjs =~ s%\Q/* alertify\.js */\E%$js%; |
| 29 |
$angularjs =~ s%\Q/* style\.css */\E%$css%; |
| 30 |
print $angularjs; |
| 31 |
' | uglifyjs > dist/js/ngAlertify.js |
| 32 |
|