minified bower files

This commit is contained in:
David Baldwynn 2016-04-22 23:10:26 -04:00
parent 63275dbe6a
commit e4db1eb2f1
3 changed files with 18 additions and 7 deletions

View file

@ -32,7 +32,7 @@
<!-- Fav Icon -->
<link href="/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.min.css">
<!--Bower CSS dependencies-->
{% for bowerCssFile in bowerCssFiles %}

View file

@ -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"
}
}
}

View file

@ -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/');
};
/**