This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>SVG ICONS</title> | |
<style> | |
<%- theme %> | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const glob = require("glob"); | |
const path = require('path'); | |
const ejs = require('ejs'); | |
let template = ` | |
<span style="visibility: hidden; position: absolute; z-index: -1;"> | |
<!-- SVG-Sprite --> | |
<%- svgsprite %> | |
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const imagemin = require('imagemin'); | |
const imageminSvgo = require('imagemin-svgo'); | |
imagemin(['svg/icons/*.svg'], 'svg/dist/icons/', { | |
use: [ | |
imageminSvgo({ | |
plugins: [ | |
{cleanupIDs: {remove: false}}, | |
{cleanupNumericValues: {floatPrecision: 2}}, | |
{removeViewBox: false}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"rimraf": "rimraf svg/dist", | |
"imageminsvgo": "node svg/imagemin-svgo.js", | |
"prebuildsprite": "npm run imageminsvgo", | |
"buildsprite": "svgstore -o svg/dist/svgsprite.svg svg/dist/icons/**/*.svg --inline", | |
"embedsprite": "node svg/embed-sprite.js", | |
"svgsprite": "npm run rimraf && npm run buildsprite && npm run embedsprite" | |
} |