Skip to content

Instantly share code, notes, and snippets.

@yyx990803
Last active December 28, 2015 19:29
Show Gist options
  • Save yyx990803/7550524 to your computer and use it in GitHub Desktop.
Save yyx990803/7550524 to your computer and use it in GitHub Desktop.
config:
sass:
build:
files:
static/css/style/css: client/sass/main.sass
componentbuild:
build:
src: .
dest: ./static/js/
options:
standalone: true
jshint:
build:
src:
- client/js/**/*.js
options:
jshintrc: true
watch:
options:
livereload: true
component:
files:
- client/js/**/*.js
- component.json
tasks: componentbuild
sass:
files:
- client/sass/**/*.sass
tasks: sass
options:
nospawn: true
npm:
- grunt-contrib-watch
- grunt-contrib-sass
- grunt-contrib-jshint
- grunt-component-build
tasks:
build:
- sass
- componentbuild
- jshint
default:
- build
// https://github.com/yyx990803/gruntfile-yaml
module.exports = function (grunt) {
var y = grunt.file.readYAML('grunt.yaml')
grunt.initConfig(y.config)
y.npm.forEach(function (t) {
grunt.loadNpmTasks(t)
})
for (var task in y.tasks) {
grunt.registerTask(task, y.tasks[task])
}
}
// npm install gruntfile-yaml
// short version:
module.exports = require('gruntfile-yaml')
// or if you still need custom js:
module.exports = function (grunt) {
require('gruntfile-yaml')(grunt)
// do your own stuff...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment