Browse Source

Added gulp-inject

Tobias Reich 9 years ago
parent
commit
895b82edd0
4 changed files with 22 additions and 1 deletions
  1. 0 0
      dist/main.css
  2. 1 0
      index.html
  3. 20 1
      src/gulpfile.js
  4. 1 0
      src/package.json

File diff suppressed because it is too large
+ 0 - 0
dist/main.css


File diff suppressed because it is too large
+ 1 - 0
index.html


+ 20 - 1
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: '<!-- inject:svg -->',
+				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');
 

+ 1 - 0
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",

Some files were not shown because too many files changed in this diff