Skip to content

Commit 3791729

Browse files
committed
[enh] Fix release
1 parent 5b87c4c commit 3791729

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

gulpfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ function webClean() {
277277

278278
function webCopyFiles() {
279279
log(colors.green('Preparing dist/web files...'));
280+
let htmlminOptions = {removeComments: true, collapseWhitespace: true};
280281

281282
var tmpPath = './dist/web/www';
282283
return es.merge(
@@ -291,15 +292,15 @@ function webCopyFiles() {
291292
.pipe(removeCode({"no-device": true}))
292293
.pipe(removeHtml('.hidden-no-device'))
293294
.pipe(removeHtml('[remove-if][remove-if="no-device"]'))
294-
.pipe(htmlmin())
295+
.pipe(htmlmin(htmlminOptions))
295296
.pipe(gulp.dest(tmpPath + '/templates')),
296297

297298
// Copy index.html (and remove unused code)
298299
gulp.src('./www/index.html')
299300
.pipe(removeCode({'no-device': true}))
300301
.pipe(removeHtml('.hidden-no-device'))
301302
.pipe(removeHtml('[remove-if][remove-if="no-device"]'))
302-
.pipe(htmlmin())
303+
.pipe(htmlmin(/*no options, to keep comments*/))
303304
.pipe(gulp.dest(tmpPath)),
304305

305306
// Copy API index.html

hooks/after_prepare/020_remove_code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ if (rootdir) {
6767
.pipe(removeHtml('.hidden-xs.hidden-sm'))
6868
.pipe(removeHtml('.hidden-device'))
6969
.pipe(removeHtml('[remove-if][remove-if="device"]'))
70-
.pipe(htmlmin(/*no options, to build comments*/))
70+
.pipe(htmlmin(/*no options, to keep comments*/))
7171
.pipe(gulp.dest(wwwPath)),
7272

7373
// Remove unused JS code + add ng annotations

hooks/after_prepare/040_useref.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ const gulp = require('gulp'),
77
filter = require('gulp-filter'),
88
uglify = require('gulp-uglify-es').default,
99
csso = require('gulp-csso'),
10-
rev = require('gulp-rev'),
11-
revReplace = require('gulp-rev-replace'),
1210
log = require('fancy-log'),
1311
colors = require('ansi-colors');
1412

@@ -42,9 +40,9 @@ if (rootdir && !skip) {
4240

4341
let indexPath = path.join(wwwPath, 'index.html');
4442

43+
const indexFilter = filter('**/index.html', {restore: true});
4544
const jsFilter = filter(['**/*.js', '!**/vendor/*', '!**/config.js'], { restore: true });
4645
const cssFilter = filter('**/*.css', { restore: true });
47-
const revFilesFilter = filter(['**/*', '!**/index.html', '!**/config.js'], { restore: true });
4846
const uglifyOptions = {
4947
toplevel: true,
5048
warnings: true,
@@ -69,16 +67,15 @@ if (rootdir && !skip) {
6967
es.concat(
7068
gulp.src(indexPath)
7169
.pipe(useref()) // Concatenate with gulp-useref
70+
7271
.pipe(jsFilter)
7372
.pipe(uglify(uglifyOptions)) // Minify any javascript sources
7473
.pipe(jsFilter.restore)
74+
7575
.pipe(cssFilter)
7676
.pipe(csso()) // Minify any CSS sources
7777
.pipe(cssFilter.restore)
78-
.pipe(revFilesFilter)
79-
.pipe(rev()) // Rename the concatenated files (but not index.html)
80-
.pipe(revFilesFilter.restore)
81-
.pipe(revReplace()) // Substitute in new filenames
78+
8279
.pipe(gulp.dest(wwwPath))
8380
);
8481
}

0 commit comments

Comments
 (0)