Switched javascript to CoffeeScript
This commit is contained in:
parent
4a4f694831
commit
f473bdf9ab
24
Gruntfile.js
24
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']);
|
||||
|
||||
};
|
||||
|
@ -1,3 +0,0 @@
|
||||
$(document).ready(function() {
|
||||
console.log("ready");
|
||||
});
|
2
assets/scripts/bedabin.coffee
Normal file
2
assets/scripts/bedabin.coffee
Normal file
@ -0,0 +1,2 @@
|
||||
$ ->
|
||||
console.log('ready.')
|
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user