Switched javascript to CoffeeScript

This commit is contained in:
Gregory Ballantine 2024-06-03 12:44:13 -04:00
parent 4a4f694831
commit f473bdf9ab
4 changed files with 17 additions and 14 deletions

View File

@ -19,14 +19,18 @@ module.exports = function(grunt) {
} }
}, },
uglify: { coffee: {
options: { options: {
mangle: false sourceMap: true,
style: 'compressed'
}, },
compile: { files: {
files: { expand: true,
'public/js/bedabin.min.js': ['assets/js/**/*.js'] flatten: true,
} cwd: 'assets/scripts',
src: ['*.coffee'],
dest: 'public/js',
ext: '.js'
} }
}, },
@ -39,8 +43,8 @@ module.exports = function(grunt) {
spawn: false spawn: false
} }
}, },
js: { coffee: {
files: ['assets/js/**/*.js'], files: ['assets/scripts/**/*.coffee'],
tasks: ['uglify'], tasks: ['uglify'],
options: { options: {
atBegin: true, atBegin: true,
@ -53,9 +57,9 @@ module.exports = function(grunt) {
// Load plugins. // Load plugins.
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-coffee');
// CLI tasks. // CLI tasks.
grunt.registerTask('default', ['sass', 'uglify']); grunt.registerTask('default', ['sass', 'coffee']);
}; };

View File

@ -1,3 +0,0 @@
$(document).ready(function() {
console.log("ready");
});

View File

@ -0,0 +1,2 @@
$ ->
console.log('ready.')

View File

@ -19,7 +19,7 @@
"dependencies": { "dependencies": {
"grunt": "^1.5.3", "grunt": "^1.5.3",
"grunt-contrib-sass": "^2.0.0", "grunt-contrib-sass": "^2.0.0",
"grunt-contrib-uglify": "^5.2.2", "grunt-contrib-coffee": "^2.1.0",
"grunt-contrib-watch": "^1.1.0", "grunt-contrib-watch": "^1.1.0",
"sass": "^1.56.1" "sass": "^1.56.1"
} }