diff --git a/app/views/layout.server.view.html b/app/views/layout.server.view.html index dbc721a5..72c87c23 100755 --- a/app/views/layout.server.view.html +++ b/app/views/layout.server.view.html @@ -32,7 +32,7 @@ - + {% for bowerCssFile in bowerCssFiles %} diff --git a/bower.json b/bower.json index 0d795f86..5dd30f66 100755 --- a/bower.json +++ b/bower.json @@ -18,7 +18,6 @@ "angular-ui-utils": "~3.0.0", "angular-ui-router": "~0.2.11", "angular-strap": "~2.3.1", - "restangular": "~1.5.1", "ng-file-upload": "~10.0.2", "angular-raven": "~0.5.11", "angular-ui-date": "~0.0.8", @@ -28,7 +27,6 @@ "angular-input-stars": "*", "file-saver.js": "~1.20150507.2", "angular-bootstrap-colorpicker": "~3.0.19", - "components-font-awesome": "~4.4.0", "angular-ui-router-tabs": "~1.7.0", "angular-scroll": "^1.0.0", "ui-select": "angular-ui-select#^0.16.1", @@ -39,5 +37,10 @@ "resolutions": { "angular-bootstrap": "^0.14.0", "angular": "1.4.x" - } + }, + "overrides": { + "BOWER-PACKAGE": { + "main": "**/*.min.js" + } + } } diff --git a/config/config.js b/config/config.js index 93a1d0c0..6a3c1f13 100755 --- a/config/config.js +++ b/config/config.js @@ -9,6 +9,14 @@ var _ = require('lodash'), path = require('path'), fs = require('fs'); +var exists = require('path-exists').sync; + +var minBowerFiles = function(type){ + return bowerFiles(type).map( function(path, index, arr) { + var newPath = path.replace(/.([^.]+)$/g, '.min.$1'); + return exists( newPath ) ? newPath : path; + }); +} /** * Load app configurations */ @@ -74,13 +82,13 @@ module.exports.removeRootDir = function(files, root) { * Get the app's bower dependencies */ module.exports.getBowerJSAssets = function() { - return this.removeRootDir(bowerFiles('**/**.js'), 'public/'); + return this.removeRootDir(minBowerFiles('**/**.js'), 'public/'); }; module.exports.getBowerCSSAssets = function() { - return this.removeRootDir(bowerFiles('**/**.css'), 'public/'); + return this.removeRootDir(minBowerFiles('**/**.css'), 'public/'); }; module.exports.getBowerOtherAssets = function() { - return this.removeRootDir(bowerFiles('**/!(*.js|*.css|*.less)'), 'public/'); + return this.removeRootDir(minBowerFiles('**/!(*.js|*.css|*.less)'), 'public/'); }; /**