1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-24 19:04:08 +01:00

convert svgs to components

This commit is contained in:
Matthias Kretschmann 2018-07-21 19:26:11 +02:00
parent ae5bc63a02
commit 3fa552016e
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 35 additions and 20 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ yarn.lock
package-lock.json
public
.cache
src/components/svg

View File

@ -7,15 +7,16 @@
"license": "MIT",
"main": "index.js",
"scripts": {
"start": "gatsby develop",
"build": "gatsby build",
"start": "npm run svg && gatsby develop",
"build": "npm run svg && gatsby build",
"format": "prettier --write 'src/**/*.{js,jsx}'",
"format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'",
"lint:js": "eslint ./gatsby-*.js && eslint ./src/**/*.jsx",
"lint:css": "stylelint ./src/**/*.{css,scss}",
"lint": "npm run lint:js && npm run lint:css",
"lint": "npm run svg && npm run lint:js && npm run lint:css",
"test": "npm run lint",
"deploy": "./scripts/deploy.sh"
"deploy": "./scripts/deploy.sh",
"svg": "./scripts/svg.sh"
},
"browserslist": [
"last 3 versions"
@ -23,23 +24,23 @@
"dependencies": {
"clipboard": "^2.0.1",
"exif-js": "^2.3.0",
"gatsby": "^2.0.0-beta.54",
"gatsby-image": "^2.0.0-beta.6",
"gatsby-plugin-catch-links": "^2.0.2-beta.3",
"gatsby": "^2.0.0-beta.55",
"gatsby-image": "^2.0.0-beta.7",
"gatsby-plugin-catch-links": "^2.0.2-beta.4",
"gatsby-plugin-matomo": "^0.4.1",
"gatsby-plugin-react-helmet": "^3.0.0-beta.3",
"gatsby-plugin-sass": "^2.0.0-beta.5",
"gatsby-plugin-sharp": "^2.0.0-beta.6",
"gatsby-plugin-sitemap": "^2.0.0-beta.2",
"gatsby-remark-autolink-headers": "^2.0.0-beta.3",
"gatsby-remark-copy-linked-files": "^2.0.0-beta.2",
"gatsby-remark-images": "^2.0.1-beta.8",
"gatsby-remark-prismjs": "^3.0.0-beta.3",
"gatsby-remark-smartypants": "^2.0.0-beta.2",
"gatsby-source-filesystem": "^2.0.1-beta.8",
"gatsby-transformer-remark": "^2.1.1-beta.3",
"gatsby-transformer-sharp": "^2.1.1-beta.5",
"gatsby-transformer-yaml": "^2.1.1-beta.2",
"gatsby-plugin-react-helmet": "^3.0.0-beta.4",
"gatsby-plugin-sass": "^2.0.0-beta.6",
"gatsby-plugin-sharp": "^2.0.0-beta.7",
"gatsby-plugin-sitemap": "^2.0.0-beta.3",
"gatsby-remark-autolink-headers": "^2.0.0-beta.4",
"gatsby-remark-copy-linked-files": "^2.0.0-beta.3",
"gatsby-remark-images": "^2.0.1-beta.9",
"gatsby-remark-prismjs": "^3.0.0-beta.4",
"gatsby-remark-smartypants": "^2.0.0-beta.3",
"gatsby-source-filesystem": "^2.0.1-beta.9",
"gatsby-transformer-remark": "^2.1.1-beta.4",
"gatsby-transformer-sharp": "^2.1.1-beta.6",
"gatsby-transformer-yaml": "^2.1.1-beta.3",
"graphql": "^0.13.2",
"intersection-observer": "^0.5.0",
"node-sass": "^4.9.2",
@ -53,6 +54,7 @@
"vex-js": "^4.1.0"
},
"devDependencies": {
"@svgr/cli": "^2.1.1",
"babel-eslint": "^8.2.6",
"eslint": "^5.2.0",
"eslint-config-prettier": "^2.9.0",

12
scripts/svg.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
SRC='./src/images'
OUT='./src/components/svg'
printf "Creating SVG components...\\n\\n"
# Usage: svgr [-d out-dir] [src-dir]
./node_modules/@svgr/cli/bin/svgr --icon -d $OUT $SRC
printf "\\n🎉 Successfully created SVG components\\n\\n"