Skip to content

Instantly share code, notes, and snippets.

@UncleKo
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UncleKo/0f6ca684818d1cc44897 to your computer and use it in GitHub Desktop.
Save UncleKo/0f6ca684818d1cc44897 to your computer and use it in GitHub Desktop.
a Sample of gruntfile.js
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.initConfig({
connect: {
server: {
options: {
port: 3501,
hostname: 'localhost'
}
}
},
open: {
server: {
path: 'http://localhost:<%= connect.server.options.port %>'
}
},
uglify: {
my_target: {
files: {
'_/js/script.js': ['_/components/js/*.js']
} //files
} //my_target
}, //uglify
compass: {
dev: {
options: {
config: 'config.rb',
sourcemap: true
} //options
} //dev
}, //compass
watch: {
options: {livereload: true},
scripts: {
files: ['_/components/js/*.js'],
tasks: ['uglify']
}, //scripts
sass: {
files: ['_/components/sass/*.scss'],
tasks: ['compass:dev']
}, //sass
html: {
files: ['*.html']
}
} //watch
}) //initConfig
grunt.registerTask('default', ['connect', 'open', 'watch']);
} //exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment