use libsass (#22)

Avoid ruby dependency
This commit is contained in:
Xaver Maierhofer 2016-05-19 17:47:13 +02:00 committed by PetaByteBoy // Milan Pässler
parent ce8853c0fa
commit e1e510c308
4 changed files with 26 additions and 11 deletions

View File

@ -17,7 +17,7 @@ module.exports = function (grunt) {
grunt.loadTasks("tasks") grunt.loadTasks("tasks")
grunt.registerTask("default", ["bower-install-simple", "lint", "saveRevision", "copy", "sass", "requirejs"]) grunt.registerTask("default", ["bower-install-simple", "lint", "saveRevision", "copy", "sass", "postcss", "requirejs"])
grunt.registerTask("lint", ["eslint"]) grunt.registerTask("lint", ["eslint"])
grunt.registerTask("dev", ["default", "connect:server", "watch"]) grunt.registerTask("dev", ["default", "connect:server", "watch"])
} }

View File

@ -21,18 +21,16 @@ HopGlass is a frontend for the [HopGlass Server](https://github.com/plumpudding/
# Installing dependencies # Installing dependencies
Install npm and Sass with your package-manager. On Debian-like systems run: Install npm package-manager. On Debian-like systems run:
sudo apt-get install npm ruby-sass sudo apt-get install npm
or if you have bundler you can install ruby-sass simply via `bundle install`
On Mac you have to install only npm via brew and sass On Mac you have to install only npm via brew and sass
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install node brew install node
sudo gem install sass sudo gem install sass
Execute these commands on your server as a normal user to prepare the dependencies: Execute these commands on your server as a normal user to prepare the dependencies:
git clone https://github.com/plumpudding/hopglass git clone https://github.com/plumpudding/hopglass

View File

@ -4,6 +4,7 @@
"test": "node -e \"require('grunt').cli()\" '' clean lint" "test": "node -e \"require('grunt').cli()\" '' clean lint"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.3.3",
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-check-dependencies": "^0.6.0", "grunt-check-dependencies": "^0.6.0",
"grunt-contrib-clean": "^0.6.0", "grunt-contrib-clean": "^0.6.0",
@ -11,7 +12,8 @@
"grunt-contrib-copy": "^0.5.0", "grunt-contrib-copy": "^0.5.0",
"grunt-contrib-cssmin": "^0.12.2", "grunt-contrib-cssmin": "^0.12.2",
"grunt-contrib-requirejs": "^0.4.4", "grunt-contrib-requirejs": "^0.4.4",
"grunt-contrib-sass": "^0.9.2", "grunt-sass": "^1.1.0",
"grunt-postcss": "^0.7.2",
"grunt-contrib-uglify": "^0.5.1", "grunt-contrib-uglify": "^0.5.1",
"grunt-contrib-watch": "^0.6.1", "grunt-contrib-watch": "^0.6.1",
"grunt-eslint": "^10.0.0", "grunt-eslint": "^10.0.0",

View File

@ -56,15 +56,29 @@ module.exports = function(grunt) {
} }
}, },
sass: { sass: {
options: {
sourceMap: true,
outputStyle: "compressed"
},
dist: { dist: {
options: {
style: "compressed"
},
files: { files: {
"build/style.css": "scss/main.scss" "build/style.css": "scss/main.scss"
} }
} }
}, },
postcss: {
options: {
map: true,
processors: [
require("autoprefixer")({
browsers: ["last 2 versions"]
})
]
},
dist: {
src: "build/style.css"
}
},
cssmin: { cssmin: {
target: { target: {
files: { files: {
@ -106,5 +120,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-bower-install-simple") grunt.loadNpmTasks("grunt-bower-install-simple")
grunt.loadNpmTasks("grunt-contrib-copy") grunt.loadNpmTasks("grunt-contrib-copy")
grunt.loadNpmTasks("grunt-contrib-requirejs") grunt.loadNpmTasks("grunt-contrib-requirejs")
grunt.loadNpmTasks("grunt-contrib-sass") grunt.loadNpmTasks("grunt-sass")
grunt.loadNpmTasks("grunt-postcss")
} }