Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created June 15, 2013 21:30
Show Gist options
  • Save lmartins/5789650 to your computer and use it in GitHub Desktop.
Save lmartins/5789650 to your computer and use it in GitHub Desktop.
Snippet: Grunt - Starter Config
module.exports = function ( grunt ) {
// set up grunt
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// The directory where we put our docs
// distdir: 'docs/',
src: {
js: ['js-src/**/*.js'],
html: ['docs/index.html'],
sass: ['css-src/system.scss']
},
connect: {
dev: {
options: {
port: 8000,
// base: '/'
}
}
},
sass: {
compile: {
options: {
includePaths: [
'css-src/libs'
]
},
files: {
'css/system.css': 'css-src/system.scss',
'css/partners.css': 'css-src/partners.scss',
'css/styleguide.css': 'css-src/styleguide.scss',
'css/testes.css': 'css-src/testes.scss'
}
}
},
watch: {
options: {
livereload: true,
},
sass: {
files: [
'css-src/**/*.scss'
],
tasks: ['sass'],
options: {
// nospawn: true,
livereload: false
}
},
css: {
files: [
'css/*.css'
],
// options: {
// nospawn: true
// }
},
// js: {
// files: ['<%= src.js %>'],
// tasks: ['concat'],
// options: {
// livereload: false
// }
// },
compiledjs: {
files: ['script/**/*.js']
},
html: {
files: ['styleguide3/docs/**/*.html'],
}
},
webfont: {
icons: {
src: 'css-src/global/iconfont/icons/*.svg',
dest: 'css-src/global/iconfont',
destCss: 'css-src/global/iconfont',
options: {
stylesheet: 'scss',
relativeFontPath: '../css-src/global/iconfont/',
htmlDemo: true,
syntax: "bootstrap"
}
}
},
// OPTIMIZE SVG FILES
svgo: {
optimize: {
files: 'images/system/icons/*.svg'
}
},
cssmetrics: {
dist: {
src: [
'css/system.css',
]
}
},
csscss: {
options: {
require: 'config.rb'
},
dist: {
src: ['css-src/system.scss']
}
},
copy:{
main: {
files: {
'styleguide3/docs/views/M-icons.html': 'css-src/global/iconfont/icons.html'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-webfont');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('svgo-grunt');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-css-metrics');
grunt.loadNpmTasks('grunt-csscss');
grunt.registerTask('default', [
'connect',
'watch'
]);
grunt.registerTask('icons', [
'webfont',
'copy'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment