1
0
Fork 0

Makefile comments and formatting

This commit is contained in:
Gregory Eremin 2015-03-19 20:55:39 +07:00
parent 46cf7f600b
commit 4c2fb60652
1 changed files with 39 additions and 21 deletions

View File

@ -12,6 +12,14 @@ dist:
$(JSX) --extension jsx app/jsx app/jsx/build
# Compressing JS
#
# Get all script tags
# Ignore Bower deps, include minified versions later
# Splitting string by " and taking second field (URI)
# Adding "app" prefix
# Prepending dependencies to the list
# Concatenation
# Minification
cat app/index.html \
| grep script \
| grep -v bower \
@ -25,6 +33,13 @@ dist:
| $(UGLIFY) > build/app.js
# Compressing CSS
#
# Get all style tags
# Ignore local Open Sans stylesheet
# Splitting string by " and taking fourth field (URI)
# Adding "app" prefix
# Concatenation
# Minification
cat app/index.html \
| grep stylesheet \
| grep -v opensans \
@ -37,7 +52,10 @@ dist:
# Replacing all script tags with a single one
cat app/index.html \
| perl -pe 's/<link.*>\n/STYLE_TAG/g' \
| perl -pe 's/(STYLE_TAG\s*)+/<link rel="stylesheet" href="\/app.css">\n <link rel="stylesheet" href="http:\/\/fonts.googleapis.com\/css?family=Open\+Sans:400,300,600">\n /g' \
| perl -pe 's/(STYLE_TAG\s*)+/\
<link rel="stylesheet" href="\/app.css">\n \
<link rel="stylesheet" href="\/\/fonts.googleapis.com\/css?family=Open\+Sans:400,300,600">\n /g' \
| perl -pe 's/<script.*>\n/SCRIPT_TAG/g' \
| perl -pe 's/(SCRIPT_TAG\s*)+/<script type="text\/javascript" src="\/app.js"><\/script>\n/g' \
| perl -pe 's/(SCRIPT_TAG\s*)+/\
<script type="text\/javascript" src="\/app.js"><\/script>\n/g' \
> build/index.html