Skip to content

Instantly share code, notes, and snippets.

@joaostein
Created January 5, 2014 01:45
Show Gist options
  • Save joaostein/8263254 to your computer and use it in GitHub Desktop.
Save joaostein/8263254 to your computer and use it in GitHub Desktop.
Useful boilerplate files
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
### Node ###
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
### NPM ###
npm-debug.log
node_modules
### Bower ###
public/components
### Compiled css ###
public/stylesheets/css
.sass-cache
### PhPStorm ###
.idea/
### Db config ###
db_config.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Concatenate files
concat: {
dist: {
src: ['public/javascripts/*.js'],
dest: 'public/javascripts/application.js'
}
},
// Minify files
uglify: {
build: {
src: 'public/javascripts/application.js',
dest: 'public/javascripts/application.min.js'
}
},
// Optimize images
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'public/',
src: ['images/*.{png,jpg,gif}'],
dest: 'public/'
}]
}
},
// // Sass
// sass: {
// dist: {
// options: {
// style: 'compressed'
// },
// files: {
// 'public/stylesheets/application.css': 'public/stylesheets/application.sass'
// }
// }
// },
// Compass
compass: {
dist: {
options: {
sassDir: 'public/stylesheets/sass',
cssDir: 'public/stylesheets/css'
}
}
},
// Watch for changes and run tasks
watch: {
options: {
livereload: true,
},
scripts: {
files: ['public/javascripts/*.js'],
tasks: ['concat', 'uglify'],
options: {
spawn: false,
}
},
css: {
files: ['public/stylesheets/sass/*.sass'],
tasks: ['compass'],
options: {
spawn: false,
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
// grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['concat', 'uglify', 'imagemin']);
grunt.registerTask('dev', ['watch']);
};
{
"name": "appname",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "nodemon app.js"
},
"dependencies": {
"express": "3.4.0",
"jade": "*"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-imagemin": "~0.4.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-compass": "~0.7.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment