Skip to content

Instantly share code, notes, and snippets.

@nickmealey
Created June 16, 2016 03:58
Show Gist options
  • Save nickmealey/bdc21bc847feb7dd6a2c794c66757341 to your computer and use it in GitHub Desktop.
Save nickmealey/bdc21bc847feb7dd6a2c794c66757341 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// The order of JS files that get loaded
var build_files = ['scripts/app/app.js',
'scripts/lib/*.js',
'scripts/models/*.js',
'scripts/plugins/*.js',
'scripts/controllers/*.js'
];
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['scripts/**/*.js'],
tasks: ['concat'],
options: {
spawn: false
},
},
css: {
files: ['sass/**/*.sass', 'sass/**/*.scss'],
tasks: ['sass']
}
},
sass: {
dist: {
options: {
sourcemap: 'none'
},
files: {
'assets/styles.css.liquid' : 'sass/styles.scss'
}
}
},
concat: {
options: {
banner: '/*! <%= pkg.name %>*/\n',
beautfiy: true,
process: function(src, filepath) {
return '//------ ' + filepath + '\n' + src;
}
},
build: {
src: build_files,
dest: 'assets/<%= pkg.name %>.js'
}
}
});
// Default tasks
grunt.registerTask('default', ['uglify']);
grunt.registerTask('default', ['watch']);
// Plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment