Skip to content
Snippets Groups Projects
Commit 3791729f authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[enh] Fix release

parent 5b87c4c2
No related branches found
No related tags found
No related merge requests found
Pipeline #8456 failed
......@@ -277,6 +277,7 @@ function webClean() {
function webCopyFiles() {
log(colors.green('Preparing dist/web files...'));
let htmlminOptions = {removeComments: true, collapseWhitespace: true};
var tmpPath = './dist/web/www';
return es.merge(
......@@ -291,7 +292,7 @@ function webCopyFiles() {
.pipe(removeCode({"no-device": true}))
.pipe(removeHtml('.hidden-no-device'))
.pipe(removeHtml('[remove-if][remove-if="no-device"]'))
.pipe(htmlmin())
.pipe(htmlmin(htmlminOptions))
.pipe(gulp.dest(tmpPath + '/templates')),
// Copy index.html (and remove unused code)
......@@ -299,7 +300,7 @@ function webCopyFiles() {
.pipe(removeCode({'no-device': true}))
.pipe(removeHtml('.hidden-no-device'))
.pipe(removeHtml('[remove-if][remove-if="no-device"]'))
.pipe(htmlmin())
.pipe(htmlmin(/*no options, to keep comments*/))
.pipe(gulp.dest(tmpPath)),
// Copy API index.html
......
......@@ -67,7 +67,7 @@ if (rootdir) {
.pipe(removeHtml('.hidden-xs.hidden-sm'))
.pipe(removeHtml('.hidden-device'))
.pipe(removeHtml('[remove-if][remove-if="device"]'))
.pipe(htmlmin(/*no options, to build comments*/))
.pipe(htmlmin(/*no options, to keep comments*/))
.pipe(gulp.dest(wwwPath)),
// Remove unused JS code + add ng annotations
......
......@@ -7,8 +7,6 @@ const gulp = require('gulp'),
filter = require('gulp-filter'),
uglify = require('gulp-uglify-es').default,
csso = require('gulp-csso'),
rev = require('gulp-rev'),
revReplace = require('gulp-rev-replace'),
log = require('fancy-log'),
colors = require('ansi-colors');
......@@ -42,9 +40,9 @@ if (rootdir && !skip) {
let indexPath = path.join(wwwPath, 'index.html');
const indexFilter = filter('**/index.html', {restore: true});
const jsFilter = filter(['**/*.js', '!**/vendor/*', '!**/config.js'], { restore: true });
const cssFilter = filter('**/*.css', { restore: true });
const revFilesFilter = filter(['**/*', '!**/index.html', '!**/config.js'], { restore: true });
const uglifyOptions = {
toplevel: true,
warnings: true,
......@@ -69,16 +67,15 @@ if (rootdir && !skip) {
es.concat(
gulp.src(indexPath)
.pipe(useref()) // Concatenate with gulp-useref
.pipe(jsFilter)
.pipe(uglify(uglifyOptions)) // Minify any javascript sources
.pipe(jsFilter.restore)
.pipe(cssFilter)
.pipe(csso()) // Minify any CSS sources
.pipe(cssFilter.restore)
.pipe(revFilesFilter)
.pipe(rev()) // Rename the concatenated files (but not index.html)
.pipe(revFilesFilter.restore)
.pipe(revReplace()) // Substitute in new filenames
.pipe(gulp.dest(wwwPath))
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment