diff --git a/gulpfile.js b/gulpfile.js
index 81f914b..857b81c 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -2,6 +2,7 @@ var gulp = require('gulp');
var gulpLoadPlugins = require('gulp-load-plugins');
var browserSync = require('browser-sync');
var del = require('del');
+var fs = require('fs');
var $ = gulpLoadPlugins();
var reload = browserSync.reload;
@@ -149,6 +150,66 @@ gulp.task('info', function () {
gulp.task('build', $.sequence('lint', 'html', 'langs', 'images', 'fonts', 'manifest', 'extras', 'info'));
+gulp.task('bundle-assets', function () {
+ return gulp.src('dist/index.html')
+ .pipe($.replace(//g, function(match, fileName) {
+ var content = fs.readFileSync('dist/' + fileName, 'utf8');
+ return '';
+ }))
+ .pipe($.replace(/';
+ }))
+ .pipe($.replace(/url\(\.\.\/(fonts\/[a-zA-Z0-9\-]+\.woff)(\?[a-zA-Z0-9\-_=.]+)?\)/g, function(match, fileName) {
+ if (!fs.existsSync('dist/' + fileName)) {
+ return match;
+ }
+
+ var contentBuffer = fs.readFileSync('dist/' + fileName);
+ var contentBase64 = contentBuffer.toString('base64');
+ return 'url(data:application/x-font-woff;base64,' + contentBase64 + ')';
+ }))
+ .pipe($.replace(/<\/body>/g, function(match) {
+ var langDir = 'src/langs/';
+ var result = '