Skip to content

Instantly share code, notes, and snippets.

@alonextou
Created August 23, 2013 20:42
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 alonextou/6323799 to your computer and use it in GitHub Desktop.
Save alonextou/6323799 to your computer and use it in GitHub Desktop.
{
"name": "app",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-watch": "~0.5.1",
"grunt-contrib-compass": "~0.3.0",
"grunt-contrib-jshint": "~0.4.1",
"grunt-usemin": "~0.1.12",
"grunt-neuter": "0.5.0",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-uglify": "~0.2.0",
}
}
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
sass: {
files: 'public/sass/*',
tasks: ['compass:dev']
},
neuter: {
files: ['public/js/app/**/*.js'],
tasks: ['neuter']
}
},
compass: {
dev: {
options: {
sassDir: 'public/sass',
cssDir: 'public/css',
}
},
dist: {
options: {
sassDir: 'public/sass',
cssDir: 'dist/css',
outputStyle: 'compressed'
}
}
},
neuter: {
dev: {
options: {
filepathTransform: function (filepath) {
return 'public/js/app/' + filepath;
}
},
src: 'public/js/app/app.js',
dest: 'public/js/global.js'
}
},
copy: {
dev: {
files: [{
expand: true,
dot: true,
cwd: 'public/',
dest: 'dist/',
src: [
'js/global.js'
]
}]
}
},
useminPrepare: {
html: 'app/views/templates/**/*.php',
options: {
dest: 'dist/'
}
},
usemin: {
html: ['dist/index.php'],
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-neuter');
grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.registerTask('default', ['compass:dev', 'neuter']);
grunt.registerTask('dist', ['compass:dist', 'neuter', 'copy', 'useminPrepare', 'concat', 'uglify', 'usemin' ]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment