diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-03-31 19:01:00 -0700 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-03-31 19:01:01 -0700 |
commit | 68e35758c33168e9b3fe1c678e07d52b42879720 (patch) | |
tree | a511236bdb8968394b27f484f4b7cfc745dcd217 /Gruntfile.js | |
parent | 84d703c6f5ffd8a3cfc652083ad17411f73b51ba (diff) | |
download | gitbook-68e35758c33168e9b3fe1c678e07d52b42879720.zip gitbook-68e35758c33168e9b3fe1c678e07d52b42879720.tar.gz gitbook-68e35758c33168e9b3fe1c678e07d52b42879720.tar.bz2 |
Add base for javascript compilation using requirejs
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 3dd0d82..3fc66ec 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,6 +3,7 @@ module.exports = function (grunt) { // Load NPM tasks grunt.loadNpmTasks('grunt-contrib-less'); + grunt.loadNpmTasks('grunt-contrib-requirejs'); // Init GRUNT configuraton grunt.initConfig({ @@ -18,12 +19,33 @@ module.exports = function (grunt) { "assets/static/style.css": "assets/stylesheets/main.less" } } + }, + requirejs: { + compile: { + options: { + name: "app", + baseUrl: "assets/javascript/", + out: "assets/static/app.js", + preserveLicenseComments: false, + optimize: "uglify", + include: ["requireLib"], + paths: { + "requireLib": 'vendors/require', + }, + shim: { + 'jQuery': { + exports: '$' + } + } + } + } } }); // Build grunt.registerTask('build', [ - 'less' + 'less', + 'requirejs' ]); grunt.registerTask('default', [ |