1
Fork 0

Build SCSS logically

This commit is contained in:
Jake Howard 2016-05-16 18:20:16 +01:00
parent 8991f1f2ab
commit 311b43cf78
3 changed files with 20 additions and 9 deletions

View file

@ -25,6 +25,7 @@
"underscore": "=1.8.3" "underscore": "=1.8.3"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "=6.3.6",
"babel-preset-es2015": "=6.1.18", "babel-preset-es2015": "=6.1.18",
"babel-preset-react": "=6.1.18", "babel-preset-react": "=6.1.18",
"babelify": "=7.3.0", "babelify": "=7.3.0",
@ -35,6 +36,7 @@
"eslint-plugin-react": "=3.4.2", "eslint-plugin-react": "=3.4.2",
"markdown-spellcheck": "=0.10.0", "markdown-spellcheck": "=0.10.0",
"node-sass": "=3.7.0", "node-sass": "=3.7.0",
"postcss-cli": "=2.5.2",
"sass-lint": "=1.7.0", "sass-lint": "=1.7.0",
"uglify-js": "=2.6.2" "uglify-js": "=2.6.2"
} }

View file

@ -2,12 +2,19 @@
set -e set -e
mkdir -p theme/static/src/scss/css if [[ $BUILD_PRODUCTION ]]
then
# scss can't import css, so copy them into src dir and change the extension! echo ">>> WARNING: Building in Production Mode!"
cp node_modules/animate.css/animate.css theme/static/src/scss/css/animate.scss fi
echo ">> Building SCSS..."
node-sass theme/static/src/scss/index.scss theme/static/build/css/index.css --source-map-embed node-sass theme/static/src/scss/index.scss theme/static/build/css/index.css --source-map-embed
# Cleanup echo ">> Post-Processing..."
rm -rf theme/static/src/scss/css postcss -u autoprefixer -o theme/static/build/css/index.css theme/static/build/css/index.css
if [[ $BUILD_PRODUCTION ]]
then
echo ">> Compressing CSS..."
cleancss -d --s0 -o theme/static/build/css/index.css theme/static/build/css/index.css
fi

View file

@ -5,19 +5,21 @@
/* @end Fonts */ /* @end Fonts */
/* @group Libraries */ /* @group Libraries */
@import "node_modules/bootstrap-sass/assets/stylesheets/_bootstrap"; @import "node_modules/bootstrap-sass/assets/stylesheets/_bootstrap";
@import "css/animate"; @import "node_modules/animate.css/animate";
/* @end Libraries */ /* @end Libraries */
/* @group Other Imports */
@import "variables"; @import "variables";
@import "creative/creative"; @import "creative/creative";
/* @group Other Imports */
/* @end Other Imports */ /* @end Other Imports */
@import "homepage"; @import "homepage";