summaryrefslogtreecommitdiffstats
path: root/Gruntfile.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-20 11:29:26 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-20 11:29:26 +0100
commit238cd9f7f09f11ecdb1717a5d07fc33642d29043 (patch)
tree72eac94839bda4f32cb41441b2b88532eed52603 /Gruntfile.js
parentbac25cdf297a7fa54f21977aa17d455e439cdf51 (diff)
downloadgitbook-238cd9f7f09f11ecdb1717a5d07fc33642d29043.zip
gitbook-238cd9f7f09f11ecdb1717a5d07fc33642d29043.tar.gz
gitbook-238cd9f7f09f11ecdb1717a5d07fc33642d29043.tar.bz2
Add back theme
Diffstat (limited to 'Gruntfile.js')
-rw-r--r--Gruntfile.js96
1 files changed, 96 insertions, 0 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..1a84763
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,96 @@
+module.exports = function (grunt) {
+ var path = require("path");
+
+ // Load NPM tasks
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-less');
+ grunt.loadNpmTasks('grunt-contrib-requirejs');
+ grunt.loadNpmTasks("grunt-bower-install-simple");
+
+ // Init GRUNT configuraton
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ 'bower-install-simple': {
+ options: {
+ color: true,
+ production: false,
+ directory: "theme/vendors"
+ }
+ },
+ less: {
+ development: {
+ options: {
+ compress: true,
+ yuicompress: true,
+ optimization: 2
+ },
+ files: {
+ "theme/assets/style.css": "theme/stylesheets/website.less",
+ "theme/assets/print.css": "theme/stylesheets/ebook.less"
+ }
+ }
+ },
+ requirejs: {
+ compile: {
+ options: {
+ name: "gitbook",
+ baseUrl: "theme/javascript/",
+ out: "theme/assets/app.js",
+ preserveLicenseComments: false,
+ optimize: "uglify",
+ include: ["requireLib"],
+ paths: {
+ "jQuery": '../vendors/jquery/dist/jquery',
+ "lodash": '../vendors/lodash/dist/lodash',
+ "requireLib": '../vendors/requirejs/require',
+ "Mousetrap": '../vendors/mousetrap/mousetrap',
+ "lunr": '../vendors/lunr.js/lunr',
+ "URIjs": '../vendors/URIjs/src/',
+ "ace": '../vendors/ace-builds/src-noconflict/'
+ },
+ shim: {
+ 'jQuery': {
+ exports: '$'
+ },
+ 'lodash': {
+ exports: '_'
+ },
+ 'Mousetrap': {
+ exports: 'Mousetrap'
+ },
+ 'lunr': {
+ exports: 'lunr'
+ }
+ }
+ }
+ }
+ },
+ copy: {
+ vendors: {
+ files: [
+ {
+ expand: true,
+ cwd: 'theme/vendors/fontawesome/fonts/',
+ src: ['**'],
+ dest: 'theme/assets/fonts/fontawesome/',
+ filter: 'isFile'
+ }
+ ]
+ }
+ }
+ });
+
+ grunt.registerTask("bower-install", [ "bower-install-simple" ]);
+
+ // Build
+ grunt.registerTask('build', [
+ 'bower-install',
+ 'less',
+ 'requirejs',
+ 'copy:vendors'
+ ]);
+
+ grunt.registerTask('default', [
+ 'build'
+ ]);
+};