1
0
Fork 0
docsearch/scripts/build-css
Vincent Voyer 3c98ea5882 chore(stack update): update the whole docsearch stack (#173)
* chore(stack update): update the whole docsearch stack

In an effort to reduce our stack diversity I am moving docsearch to:
- latest eslint
- prettier
- webpack 2
- babel 6 (babel 7 is soon to be released, we were on babel 5)
- babel-preset-env (support: IE >=9, Two latest version of evergreen
browsers).
- jest

* chore(contrib): remove develop branch, cc @redox
2017-03-17 16:22:00 +01:00

23 lines
720 B
Bash
Executable file

#!/usr/bin/env bash
set -e # exit when error
NAME='docsearch'
LICENSE="/*! ${NAME} ${VERSION:-UNRELEASED} | © Algolia | github.com/algolia/docsearch */"
DIST_DIR="dist/cdn"
DIST_FILE="$DIST_DIR/${NAME}.css"
DIST_FILE_MIN="$DIST_DIR/${NAME}.min.css"
DIST_FILE_MAP="$DIST_DIR/${NAME}.min.css.map"
mkdir -p "$DIST_DIR"
# ./dist/cdn/docsearch.css
echo "$LICENSE" > "$DIST_FILE";
node-sass --output-style expanded ./src/styles/main.scss \
| postcss --use autoprefixer -o "$DIST_FILE"
# ./dist/cdn/docsearch.min.css
postcss "$DIST_FILE" --use cssnano --map "$DIST_FILE_MAP" -o "$DIST_FILE_MIN"
gzip_size=$(gzip -9 < $DIST_FILE_MIN | wc -c | pretty-bytes)
echo "=> $DIST_FILE_MIN gzipped will weight $gzip_size-bytes"