mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2026-07-12 08:39:19 +00:00
Update gulpfile to uglify riot tags and html
This commit is contained in:
22
gulpfile.js
22
gulpfile.js
@@ -9,19 +9,23 @@ var gulp = require('gulp');
|
||||
var htmlmin = require('gulp-htmlmin');
|
||||
var license = require('gulp-license');
|
||||
var riot = require('gulp-riot');
|
||||
var uglify = require('gulp-uglify');
|
||||
var minifier = require('gulp-uglify/minifier');
|
||||
var uglify = require('uglify-js-harmony');
|
||||
var useref = require('gulp-useref');
|
||||
|
||||
gulp.task('html', function() {
|
||||
var htmlFilter = filter('**/*.html');
|
||||
var assets;
|
||||
return gulp.src(['src/index.html'])
|
||||
.pipe(useref())
|
||||
.pipe(gIf(['*.js'], uglify({
|
||||
preserveComments: 'license'
|
||||
}))) // FIXME
|
||||
.pipe(gIf(['*.js', '!*.min.js'], minifier({}, uglify))) // FIXME
|
||||
.pipe(htmlFilter)
|
||||
.pipe(htmlmin())
|
||||
.pipe(htmlmin({
|
||||
removeComments: false,
|
||||
collapseWhitespace: true,
|
||||
removeRedundantAttributes: true,
|
||||
removeEmptyAttributes: true,
|
||||
minifyJS: uglify
|
||||
}))
|
||||
.pipe(htmlFilter.restore())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
@@ -34,6 +38,7 @@ gulp.task('riot-tag', ['html'], function() {
|
||||
return gulp.src('src/tags/*.tag')
|
||||
.pipe(concat('tags.js'))
|
||||
.pipe(riot())
|
||||
.pipe(minifier({}, uglify))
|
||||
.pipe(license('agpl3', {
|
||||
tiny: false,
|
||||
project: 'docker-registry-ui',
|
||||
@@ -47,6 +52,7 @@ gulp.task('riot-static-tag', ['html'], function() {
|
||||
return gulp.src(['src/tags/catalog.tag', 'src/tags/app.tag', 'src/tags/taglist.tag'])
|
||||
.pipe(concat('tags-static.js'))
|
||||
.pipe(riot())
|
||||
.pipe(minifier({}, uglify))
|
||||
.pipe(license('agpl3', {
|
||||
tiny: false,
|
||||
project: 'docker-registry-ui',
|
||||
@@ -59,7 +65,7 @@ gulp.task('riot-static-tag', ['html'], function() {
|
||||
gulp.task('scripts-static', ['html'], function() {
|
||||
return gulp.src(['src/scripts/http.js', 'src/scripts/static.js'])
|
||||
.pipe(concat('script-static.js'))
|
||||
.pipe(uglify())
|
||||
.pipe(minifier({}, uglify))
|
||||
.pipe(license('agpl3', {
|
||||
tiny: false,
|
||||
project: 'docker-registry-ui',
|
||||
@@ -72,7 +78,7 @@ gulp.task('scripts-static', ['html'], function() {
|
||||
gulp.task('scripts', ['html'], function() {
|
||||
return gulp.src(['src/scripts/http.js', 'src/scripts/script.js'])
|
||||
.pipe(concat('script.js'))
|
||||
.pipe(uglify())
|
||||
.pipe(minifier({}, uglify))
|
||||
.pipe(license('agpl3', {
|
||||
tiny: false,
|
||||
project: 'docker-registry-ui',
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"gulp-useref": "^3.0.0",
|
||||
"material-design-lite": "^1.1",
|
||||
"riot": "^2.3",
|
||||
"riotgear-router": "^1.3.1"
|
||||
"riotgear-router": "^1.3.1",
|
||||
"uglify-js-harmony": "^2.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user