diff --git a/Gruntfile.js b/Gruntfile.js index 9fb0b8d..54cc50b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,14 +19,18 @@ module.exports = function(grunt) { } }, - uglify: { + coffee: { options: { - mangle: false + sourceMap: true, + style: 'compressed' }, - compile: { - files: { - 'public/js/bedabin.min.js': ['assets/js/**/*.js'] - } + files: { + expand: true, + flatten: true, + cwd: 'assets/scripts', + src: ['*.coffee'], + dest: 'public/js', + ext: '.js' } }, @@ -39,8 +43,8 @@ module.exports = function(grunt) { spawn: false } }, - js: { - files: ['assets/js/**/*.js'], + coffee: { + files: ['assets/scripts/**/*.coffee'], tasks: ['uglify'], options: { atBegin: true, @@ -53,9 +57,9 @@ module.exports = function(grunt) { // Load plugins. grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-sass'); - grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-coffee'); // CLI tasks. - grunt.registerTask('default', ['sass', 'uglify']); + grunt.registerTask('default', ['sass', 'coffee']); }; diff --git a/assets/js/bedabin.js b/assets/js/bedabin.js deleted file mode 100644 index a8e0e12..0000000 --- a/assets/js/bedabin.js +++ /dev/null @@ -1,3 +0,0 @@ -$(document).ready(function() { - console.log("ready"); -}); diff --git a/assets/scripts/bedabin.coffee b/assets/scripts/bedabin.coffee new file mode 100644 index 0000000..867c33a --- /dev/null +++ b/assets/scripts/bedabin.coffee @@ -0,0 +1,2 @@ +$ -> + console.log('ready.') diff --git a/package.json b/package.json index a2970ae..5726a07 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dependencies": { "grunt": "^1.5.3", "grunt-contrib-sass": "^2.0.0", - "grunt-contrib-uglify": "^5.2.2", + "grunt-contrib-coffee": "^2.1.0", "grunt-contrib-watch": "^1.1.0", "sass": "^1.56.1" }