diff --git a/config/assets/production.js b/config/assets/production.js index 552a35f073..7ad2b2f1b4 100644 --- a/config/assets/production.js +++ b/config/assets/production.js @@ -9,6 +9,7 @@ module.exports = { // bower:css 'public/lib/bootstrap/dist/css/bootstrap.min.css', 'public/lib/bootstrap/dist/css/bootstrap-theme.min.css', + 'public/lib/ng-img-crop/compile/minified/ng-img-crop.css', // endbower ], js: [ @@ -16,16 +17,17 @@ module.exports = { 'public/lib/angular/angular.min.js', 'public/lib/angular-animate/angular-animate.min.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.min.js', - 'public/lib/angular-file-upload/dist/angular-file-upload.min.js', 'public/lib/angular-messages/angular-messages.min.js', 'public/lib/angular-mocks/angular-mocks.js', 'public/lib/angular-resource/angular-resource.min.js', 'public/lib/angular-ui-router/release/angular-ui-router.min.js', + 'public/lib/ng-file-upload/ng-file-upload.min.js', + 'public/lib/ng-img-crop/compile/minified/ng-img-crop.js', 'public/lib/owasp-password-strength-test/owasp-password-strength-test.js', // endbower ] }, - css: 'public/dist/application.min.css', - js: 'public/dist/application.min.js' + css: 'public/dist/application*.min.css', + js: 'public/dist/application*.min.js' } }; diff --git a/config/lib/express.js b/config/lib/express.js index c5b98f6bfd..4f0da6139f 100644 --- a/config/lib/express.js +++ b/config/lib/express.js @@ -158,7 +158,7 @@ module.exports.initHelmetHeaders = function (app) { */ module.exports.initModulesClientRoutes = function (app) { // Setting the app router and static folder - app.use('/', express.static(path.resolve('./public'))); + app.use('/', express.static(path.resolve('./public'), { maxAge: 86400000 })); // Globbing static routing config.folders.client.forEach(function (staticPath) { diff --git a/gulpfile.js b/gulpfile.js index ba899bd682..bb99496a68 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -24,6 +24,7 @@ var _ = require('lodash'), protractor = require('gulp-protractor').protractor, webdriver_update = require('gulp-protractor').webdriver_update, webdriver_standalone = require('gulp-protractor').webdriver_standalone, + del = require('del'), KarmaServer = require('karma').Server; // Local settings @@ -159,6 +160,7 @@ gulp.task('uglify', function () { defaultAssets.client.js, defaultAssets.client.templates ); + del(['public/dist/*']); return gulp.src(assets) .pipe(plugins.ngAnnotate()) @@ -166,6 +168,7 @@ gulp.task('uglify', function () { mangle: false })) .pipe(plugins.concat('application.min.js')) + .pipe(plugins.rev()) .pipe(gulp.dest('public/dist')); }); @@ -174,6 +177,7 @@ gulp.task('cssmin', function () { return gulp.src(defaultAssets.client.css) .pipe(plugins.csso()) .pipe(plugins.concat('application.min.css')) + .pipe(plugins.rev()) .pipe(gulp.dest('public/dist')); }); diff --git a/package.json b/package.json index e9f3b2e61a..a1bbd4ef34 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ }, "devDependencies": { "coveralls": "~2.11.6", + "del": "^2.2.2", "eslint": "~2.2.0", "eslint-config-airbnb": "~6.0.2", "gulp": "~3.9.1", @@ -97,6 +98,7 @@ "gulp-nodemon": "~2.1.0", "gulp-protractor": "~3.0.0", "gulp-rename": "~1.2.2", + "gulp-rev": "^7.1.2", "gulp-sass": "~2.3.0", "gulp-uglify": "~1.5.2", "gulp-util": "~3.0.7",