Created
April 3, 2016 17:51
-
-
Save JamesVanWaza/77f0f3ac10c296ce7770dbe658c1031b to your computer and use it in GitHub Desktop.
bootstrapgruntfile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint node: true */ | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
sass: { | |
dist: { | |
options: { | |
/** Only use include_paths if extracting elements from Bower */ | |
includePaths: ['bower_components/bootstrap-sass/assets/stylesheets'], | |
outputStyle: 'expanded', | |
sourceMap: false | |
},//options | |
files: { | |
'css/bootstrap.css': 'scss/bootstrap.scss', | |
'css/style.css': 'scss/style.scss' | |
} | |
}//dist | |
}, //sass | |
watch: { | |
options: { | |
livereload: true, | |
dateFormat: function(time) { | |
grunt.log.writeln('The watch finished in ' + time + 'ms at ' + (new Date()).toString()); | |
grunt.log.writeln('Waiting for more changes...'); | |
} //date format function | |
}, //options | |
scripts: { | |
files: ['*.js', 'js/*.js'] | |
}, // scripts | |
//Live Reload of SASS | |
sass: { | |
files: 'scss/**/*.scss', | |
tasks: ['sass'] | |
}, //sass, | |
css: { | |
files: '**/*.scss', | |
tasks: ['sass'] | |
}, //css | |
html: { | |
files: ['*.html'] | |
}, //html | |
all: { | |
files: '{,**/}*.js', | |
tasks: ['jshint'] | |
} //all | |
}, //watch | |
postcss: { | |
options: { | |
processors: [ | |
require('autoprefixer')({ | |
browsers: 'last 2 versions' | |
}) | |
] | |
} | |
}, //post css | |
jshint: { | |
options: { | |
reporter: require('jshint-stylish') | |
}, | |
target: ['*.js', 'js/*.js'], | |
all: ['*.js', 'js/*.js'] | |
} //jshint | |
}); | |
grunt.loadNpmTasks('grunt-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-postcss'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-force-task'); | |
grunt.loadNpmTasks('grunt-openport'); | |
grunt.loadNpmTasks('grunt-autoupdate'); | |
grunt.registerTask('default', ['autoupdate', 'sass', 'openport:watch.options.livereload:35729', 'watch', 'force:jshint']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment