From 895b82edd0ecff901a84c86d223cb7b4c786dd16 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 1 Apr 2015 23:39:12 +0200 Subject: [PATCH] Added gulp-inject --- dist/main.css | Bin 35638 -> 35649 bytes index.html | 47 +++++++++++++++++++++++++++++++---------------- src/gulpfile.js | 21 ++++++++++++++++++++- src/package.json | 1 + 4 files changed, 52 insertions(+), 17 deletions(-) diff --git a/dist/main.css b/dist/main.css index 08e412993af53505fe8ba3bff8bb763a75bd2bbf..58336d21525192aa0d2867f8269b42dbe7046a9e 100644 GIT binary patch delta 65 zcmdlsjp^VtrVZ!S<&{eda`F>Xbo7eL(u)g delta 40 wcmX>&jcMC7rVZ!SH@{ccXBJT|Ey&4FOsP)EEH21NthCC@&r97btF4j%09lm}-v9sr diff --git a/index.html b/index.html index 0c9cdf4..4a34025 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,21 @@ + + + + + + + + + + + + + + +
@@ -35,14 +50,14 @@ diff --git a/src/gulpfile.js b/src/gulpfile.js index 08ba53a..c1a47b7 100644 --- a/src/gulpfile.js +++ b/src/gulpfile.js @@ -54,6 +54,9 @@ gulp.task('view--scripts', ['view--js'], function() { /* Main ----------------------------------------- */ paths.main = { + html: [ + '../index.html' + ], js: [ '../src/scripts/*.js' ], @@ -72,6 +75,10 @@ paths.main = { 'bower_components/basicContext/src/styles/main.scss', 'bower_components/basicModal/src/styles/main.scss', '../src/styles/main.scss' + ], + svg: [ + './images/iconic.svg', + './images/ionicons.svg' ] } @@ -116,6 +123,18 @@ gulp.task('main--styles', function() { }); +gulp.task('main--svg', function() { + + var stream = + gulp.src(paths.main.html) + .pipe(plugins.inject(gulp.src(paths.main.svg), { + starttag: '', + transform: function(filePath, file) { return file.contents.toString('utf8') } + })) + .pipe(gulp.dest('../')); + + }); + /* Clean ----------------------------------------- */ gulp.task('clean', function() { @@ -131,7 +150,7 @@ gulp.task('clean', function() { /* Tasks ----------------------------------------- */ -gulp.task('default', ['view--scripts', 'main--scripts', 'main--styles'], function() { +gulp.task('default', ['view--scripts', 'main--svg', 'main--scripts', 'main--styles'], function() { gulp.start('clean'); diff --git a/src/package.json b/src/package.json index 83ff554..7f2c6fb 100644 --- a/src/package.json +++ b/src/package.json @@ -14,6 +14,7 @@ "gulp-autoprefixer": "2.1.0", "gulp-babel": "^4.0.0", "gulp-concat": "^2.5.2", + "gulp-inject": "^1.2.0", "gulp-load-plugins": "^0.9.0", "gulp-minify-css": "^1.0.0", "gulp-rimraf": "^0.1.1",