Created
January 13, 2014 03:09
-
-
Save imjakechapman/8394105 to your computer and use it in GitHub Desktop.
Super basic Grunt.js setup for js and css files
This file contains hidden or 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
| module.exports = function(grunt) { | |
| // load all grunt tasks | |
| require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
| grunt.initConfig({ | |
| uglify: { | |
| dist: { | |
| src: ['assets/js/vendor/jquery.js', 'assets/js/vendor/**/*.js'], | |
| dest: "assets/js/vendor.min.js" | |
| } | |
| }, | |
| sass: { | |
| options: { | |
| style: "expanded", | |
| lineNumbers: true | |
| }, | |
| dist: { | |
| files: { 'assets/styles/application.css': 'assets/styles/application.scss' } | |
| } | |
| }, | |
| watch: { | |
| scripts: { | |
| files: ['assets/js/**/*.js', '!assets/js/vendor.min.js'], | |
| tasks: ['uglify'], | |
| options: { | |
| spawn: false, | |
| }, | |
| }, | |
| css: { | |
| files: ['assets/styles/**/*.scss'], | |
| tasks: ['sass'], | |
| options: { | |
| spawn: false, | |
| } | |
| } | |
| } | |
| }); | |
| grunt.registerTask('default', ['uglify', 'sass']); | |
| }; |
This file contains hidden or 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
| { | |
| "name": "PACKAGE NAME", | |
| "version": "PACKAGE VERSION", | |
| "devDependencies": { | |
| "grunt": "~0.4.2", | |
| "grunt-contrib-sass": "~0.5.1", | |
| "grunt-contrib-watch": "~0.4.3", | |
| "grunt-contrib-uglify": "~0.2.0", | |
| "matchdep": "~0.1.2" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment