From cc57d56023c8d7d1db1de305194b645497bc38af Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 25 Oct 2014 12:25:44 +0200 Subject: [PATCH] Added external libraries to minifying process --- gruntfile.js | 18 +++++++++++++++--- public_html/index.html | 24 ++++++++++++++++-------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 5d37306e..fdcbf49d 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -7,6 +7,7 @@ require('shelljs/global'); var phpCheckStyleConfigPath = path.join(path.resolve(), 'phpcheckstyle.cfg'); var phpSourcesDir = path.join(path.resolve(), 'src'); var publicHtmlDir = path.join(path.resolve(), 'public_html'); +var libSourcesDir = path.join(publicHtmlDir, 'lib'); var jsSourcesDir = path.join(publicHtmlDir, 'js'); var cssSourcesDir = path.join(publicHtmlDir, 'css'); var templatesDir = path.join(publicHtmlDir, 'templates'); @@ -47,6 +48,7 @@ module.exports = function(grunt) { phpCheckStyleConfigPath: phpCheckStyleConfigPath, phpSourcesDir: phpSourcesDir, + libSourcesDir: libSourcesDir, jsSourcesDir: jsSourcesDir, cssSourcesDir: cssSourcesDir, @@ -92,7 +94,9 @@ module.exports = function(grunt) { cssmin: { combine: { files: { - 'public_html/app.min.css': [cssSourcesDir + '/**/*.css'], + 'public_html/app.min.css': [ + libSourcesDir + '/nprogress.css', + cssSourcesDir + '/**/*.css'], }, }, }, @@ -103,13 +107,21 @@ module.exports = function(grunt) { sourceMap: true, }, files: { - 'public_html/app.min.js': [].concat( - [jsSourcesDir + '/DI.js'], + 'public_html/app.min.js': [].concat([ + libSourcesDir + '/jquery.min.js', + libSourcesDir + '/jquery.cookie.js', + libSourcesDir + '/underscore.min.js', + libSourcesDir + '/mousetrap.min.js', + libSourcesDir + '/marked.js', + libSourcesDir + '/nprogress.js', + jsSourcesDir + '/DI.js'], + grunt.file.expand({ filter: function(src) { return !src.match(/(DI|Bootstrap)\.js/); } }, jsSourcesDir + '/**/*.js'), + [jsSourcesDir + '/Bootstrap.js']), }, }, diff --git a/public_html/index.html b/public_html/index.html index b8c69862..1e0c153a 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -24,10 +24,15 @@ - + + + + + + @@ -50,13 +55,6 @@ - - - - - - - @@ -84,6 +82,16 @@ + + + + + + + + + +