Skip to content

Instantly share code, notes, and snippets.

@edtoken
Created February 26, 2015 12:07
Show Gist options
  • Save edtoken/d292b0f062261cb274ad to your computer and use it in GitHub Desktop.
Save edtoken/d292b0f062261cb274ad to your computer and use it in GitHub Desktop.
Gruntfile.js:
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
// jshint: {
// options: {
// jshintrc: '.jshintrc'
// },
// all: [
// 'Gruntfile.js'
// ]
// },
sprite:{
all: {
src: '../5tourists/themes/frontend/frontend-sources/sprite-original/*.png',
dest: '../5tourists/web/frontend/static/images/sprite.png',
imgPath: '/static/images/sprite.png',
destImg: '../5tourists/web/frontend/static/images/sprite.png',
destCSS: '../5tourists/themes/frontend/frontend-sources/scss/sprites.scss',
cssFormat:'scss',
algorithm: 'binary-tree',
engineOpts : {
'imagemagick': true
}
}
},
sass: {
prod: {
options: {
cacheLocation:'./',
style: 'compressed',
unixNewlines:true
},
files: {
'../5tourists/web/frontend/static/css/style.min.css': '../5tourists/themes/frontend/frontend-sources/scss/project.scss'
}
},
dev: {
options: {
cacheLocation:'./',
style: 'compact',
unixNewlines:true
},
files: {
'../5tourists/web/frontend/static/css/style.css': '../5tourists/themes/frontend/frontend-sources/scss/project.scss'
}
}
},
watch: {
livereload: {
options: {
livereload: true
},
files: [
'Gruntfile.js',
'../5tourists/themes/frontend/frontend-sources/*',
'../5tourists/themes/frontend/frontend-sources/scss/*.scss',
'../5tourists/themes/frontend/frontend-sources/sprite-original/*.png'
],
tasks: ['sprite', 'sass']
}
},
});
// Load tasks
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-spritesmith');
grunt.registerTask('default',[
'sprite',
'sass'
]);
grunt.registerTask('dev', [
'watch'
]);
};
/**
*
**/
package.json:
{
"name": "get-credit",
"version": "0.0.1",
"author": "Ed <[email protected]>",
"homepage": "https://vk.com/etoed",
"repository": {
"type": "git",
"url": "git://github.com/edtoken/get-credit.git"
},
"bugs": {
"url": "https://github.com/roots/roots/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
],
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"grunt": "~0.4.3",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-sass": "~0.7.3",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment