Switched javascript to CoffeeScript
This commit is contained in:
parent
4a4f694831
commit
f473bdf9ab
22
Gruntfile.js
22
Gruntfile.js
@ -19,14 +19,18 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
uglify: {
|
coffee: {
|
||||||
options: {
|
options: {
|
||||||
mangle: false
|
sourceMap: true,
|
||||||
|
style: 'compressed'
|
||||||
},
|
},
|
||||||
compile: {
|
|
||||||
files: {
|
files: {
|
||||||
'public/js/bedabin.min.js': ['assets/js/**/*.js']
|
expand: true,
|
||||||
}
|
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']);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -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": {
|
"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"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user