Use requirejs for clientside scripting
diff --git a/Gruntfile.js b/Gruntfile.js
index f83ce25..a85cfb5 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -18,6 +18,7 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
+ /*
concat: {
dist: {
src : [
@@ -40,6 +41,23 @@
dest: 'public/js/kalamar-<%= pkg.version %>.js'
}
},
+ */
+ requirejs: {
+ compile: {
+ options: {
+ // optimize: "uglify",
+ baseUrl: 'dev/js/src',
+ paths : {
+ 'lib': '../lib'
+ },
+ wrap:true,
+ include : ['init'],
+ insertRequire: ['init'],
+ name: 'lib/almond',
+ out: 'public/js/kalamar-<%= pkg.version %>.js'
+ }
+ }
+ },
imagemin: {
dynamic: {
files: [{
@@ -120,9 +138,13 @@
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-requirejs');
+
+ grunt.registerTask('default', ['requirejs']);
+
grunt.registerTask('css', ['sass']);
grunt.registerTask(
'default',
- ['copy', 'concat', 'uglify', 'imagemin', 'sass']
+ ['copy', 'requirejs', 'imagemin', 'sass']
);
};