From ed40306bf5d95fbc17d668c36fc9b151df9313f5 Mon Sep 17 00:00:00 2001 From: Chris Ferdinandi Date: Wed, 13 May 2015 21:32:10 -0400 Subject: [PATCH] Updated SVG compiling process --- README.md | 6 ++++-- dist/css/myplugin.css | 2 +- dist/css/myplugin.min.css | 2 +- dist/js/classList.js | 2 +- dist/js/classList.min.js | 2 +- dist/js/myplugin.js | 2 +- dist/js/myplugin.min.js | 2 +- dist/svg/icons.svg | 1 - dist/svg/placeholder.svg | 1 + docs/dist/css/myplugin.css | 2 +- docs/dist/css/myplugin.min.css | 2 +- docs/dist/js/classList.js | 2 +- docs/dist/js/classList.min.js | 2 +- docs/dist/js/myplugin.js | 2 +- docs/dist/js/myplugin.min.js | 2 +- docs/dist/svg/icons.svg | 1 - docs/dist/svg/placeholder.svg | 1 + gulpfile.js | 5 ----- package.json | 2 +- 19 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 dist/svg/icons.svg create mode 100644 dist/svg/placeholder.svg delete mode 100644 docs/dist/svg/icons.svg create mode 100644 docs/dist/svg/placeholder.svg diff --git a/README.md b/README.md index 201c2eb..2b7bfb2 100755 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Make sure these are installed first. Add your files to the appropriate `src` subdirectories. Gulp will process and and compile them into `dist`. * Content in subdirectories under the `js` folder will be concatenated. For example, files in `js/detects` will compile into `detects.js`. Files directly under `js` will compile individually. -* SVGs in the `svg` directory will compile into `icons.svg`. +* SVGs in the `svg` subdirectories of the `svg` directory will compile into `icons.svg`. * Assets in the `assets` directory will be copied as-is into the `dist` directory. ``` @@ -127,7 +127,9 @@ Unit test results are printed in terminal, but you can also view them in a brows ### SVGs -SVG files placed in the `src` > `svg` directory will be compiled into a single SVG sprite called `icons.svg` in the `dist` > `svg` directory. +SVG files placed in the `src` > `svg` directory will be optimized with SVGO and compiled into `dist` > `svg` as-is. + +SVG files placed in subdirectories of `src` > `svg` will be ocmpiled into a single SVG sprite named after the parent directory. For example, files in `src` > `svg` > `icons` would compile into a single `icons.svg` file. ### Documentation diff --git a/dist/css/myplugin.css b/dist/css/myplugin.css index f169a56..5b200ed 100644 --- a/dist/css/myplugin.css +++ b/dist/css/myplugin.css @@ -1,5 +1,5 @@ /** - * gulp-boilerplate v1.3.2 + * gulp-boilerplate v2.0.0 * My Gulp.js boilerplate for creating new web projects, by Chris Ferdinandi. * http://github.com/cferdinandi/Plugin * diff --git a/dist/css/myplugin.min.css b/dist/css/myplugin.min.css index 47abda0..e7bc530 100644 --- a/dist/css/myplugin.min.css +++ b/dist/css/myplugin.min.css @@ -1 +1 @@ -/** gulp-boilerplate v1.3.2, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ +/** gulp-boilerplate v2.0.0, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ diff --git a/dist/js/classList.js b/dist/js/classList.js index 47d222b..3a36a85 100644 --- a/dist/js/classList.js +++ b/dist/js/classList.js @@ -1,5 +1,5 @@ /** - * gulp-boilerplate v1.3.2 + * gulp-boilerplate v2.0.0 * My Gulp.js boilerplate for creating new web projects, by Chris Ferdinandi. * http://github.com/cferdinandi/Plugin * diff --git a/dist/js/classList.min.js b/dist/js/classList.min.js index 9d29e10..17bb7a8 100644 --- a/dist/js/classList.min.js +++ b/dist/js/classList.min.js @@ -1,2 +1,2 @@ -/** gulp-boilerplate v1.3.2, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ +/** gulp-boilerplate v2.0.0, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ "document"in self&&!("classList"in document.createElement("_"))&&!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",i=t.Element[n],r=Object,s=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},o=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},u=function(t,e){if(""===e)throw new o("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new o("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(t,e)},c=function(t){for(var e=s.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],i=0,r=n.length;r>i;i++)this.push(n[i]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},l=c[n]=[],h=function(){return new c(this)};if(o[n]=Error[n],l.item=function(t){return this[t]||null},l.contains=function(t){return t+="",-1!==u(this,t)},l.add=function(){var t,e=arguments,n=0,i=e.length,r=!1;do t=e[n]+"",-1===u(this,t)&&(this.push(t),r=!0);while(++ni;i++)e.call(n,t[i],i,t)},l=function(t,e){var n={};return c(t,function(e,o){n[o]=t[o]}),c(e,function(t,o){n[o]=e[o]}),n},s=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t.parentNode)if("."===n){if(t.classList.contains(e.substr(1)))return t}else if("#"===n){if(t.id===e.substr(1))return t}else if("["===n&&t.hasAttribute(e.substr(1,e.length-2)))return t;return!1},u=function(t){{var e=t.target;s(e,"[data-some-selector]")}};o.destroy=function(){e&&(document.documentElement.classList.remove(e.initClass),document.removeEventListener("click",u,!1),e=null,n=null)};return o.init=function(t){i&&(o.destroy(),e=l(r,t||{}),document.documentElement.classList.add(e.initClass),document.addEventListener("click",u,!1))},o}); \ No newline at end of file diff --git a/dist/svg/icons.svg b/dist/svg/icons.svg deleted file mode 100644 index 234cf01..0000000 --- a/dist/svg/icons.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/dist/svg/placeholder.svg b/dist/svg/placeholder.svg new file mode 100644 index 0000000..31315fe --- /dev/null +++ b/dist/svg/placeholder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/dist/css/myplugin.css b/docs/dist/css/myplugin.css index f169a56..5b200ed 100644 --- a/docs/dist/css/myplugin.css +++ b/docs/dist/css/myplugin.css @@ -1,5 +1,5 @@ /** - * gulp-boilerplate v1.3.2 + * gulp-boilerplate v2.0.0 * My Gulp.js boilerplate for creating new web projects, by Chris Ferdinandi. * http://github.com/cferdinandi/Plugin * diff --git a/docs/dist/css/myplugin.min.css b/docs/dist/css/myplugin.min.css index 47abda0..e7bc530 100644 --- a/docs/dist/css/myplugin.min.css +++ b/docs/dist/css/myplugin.min.css @@ -1 +1 @@ -/** gulp-boilerplate v1.3.2, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ +/** gulp-boilerplate v2.0.0, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ diff --git a/docs/dist/js/classList.js b/docs/dist/js/classList.js index 47d222b..3a36a85 100644 --- a/docs/dist/js/classList.js +++ b/docs/dist/js/classList.js @@ -1,5 +1,5 @@ /** - * gulp-boilerplate v1.3.2 + * gulp-boilerplate v2.0.0 * My Gulp.js boilerplate for creating new web projects, by Chris Ferdinandi. * http://github.com/cferdinandi/Plugin * diff --git a/docs/dist/js/classList.min.js b/docs/dist/js/classList.min.js index 9d29e10..17bb7a8 100644 --- a/docs/dist/js/classList.min.js +++ b/docs/dist/js/classList.min.js @@ -1,2 +1,2 @@ -/** gulp-boilerplate v1.3.2, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ +/** gulp-boilerplate v2.0.0, by Chris Ferdinandi | http://github.com/cferdinandi/Plugin | Licensed under MIT: http://gomakethings.com/mit/ */ "document"in self&&!("classList"in document.createElement("_"))&&!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",i=t.Element[n],r=Object,s=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},o=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},u=function(t,e){if(""===e)throw new o("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new o("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(t,e)},c=function(t){for(var e=s.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],i=0,r=n.length;r>i;i++)this.push(n[i]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},l=c[n]=[],h=function(){return new c(this)};if(o[n]=Error[n],l.item=function(t){return this[t]||null},l.contains=function(t){return t+="",-1!==u(this,t)},l.add=function(){var t,e=arguments,n=0,i=e.length,r=!1;do t=e[n]+"",-1===u(this,t)&&(this.push(t),r=!0);while(++ni;i++)e.call(n,t[i],i,t)},l=function(t,e){var n={};return c(t,function(e,o){n[o]=t[o]}),c(e,function(t,o){n[o]=e[o]}),n},s=function(t,e){for(var n=e.charAt(0);t&&t!==document;t=t.parentNode)if("."===n){if(t.classList.contains(e.substr(1)))return t}else if("#"===n){if(t.id===e.substr(1))return t}else if("["===n&&t.hasAttribute(e.substr(1,e.length-2)))return t;return!1},u=function(t){{var e=t.target;s(e,"[data-some-selector]")}};o.destroy=function(){e&&(document.documentElement.classList.remove(e.initClass),document.removeEventListener("click",u,!1),e=null,n=null)};return o.init=function(t){i&&(o.destroy(),e=l(r,t||{}),document.documentElement.classList.add(e.initClass),document.addEventListener("click",u,!1))},o}); \ No newline at end of file diff --git a/docs/dist/svg/icons.svg b/docs/dist/svg/icons.svg deleted file mode 100644 index 234cf01..0000000 --- a/docs/dist/svg/icons.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/dist/svg/placeholder.svg b/docs/dist/svg/placeholder.svg new file mode 100644 index 0000000..31315fe --- /dev/null +++ b/docs/dist/svg/placeholder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 0a3a0e8..dcc400f 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -166,11 +166,6 @@ gulp.task('build:svgs', ['clean:dist'], function () { } })) .pipe(svgmin()) - .pipe(svgstore({ - fileName: 'icons.svg', - prefix: 'icon-', - inlineSvg: true - })) .pipe(gulp.dest(paths.svgs.output)); }); diff --git a/package.json b/package.json index 043a127..1928720 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gulp-boilerplate", - "version": "1.3.2", + "version": "2.0.0", "description": "My Gulp.js boilerplate for creating new web projects", "main": "./dist", "author": {