1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 23:21:29 -04:00

pull SVG icons directly from their NPM packages

This commit is contained in:
2022-01-11 19:19:47 -05:00
parent bc504f3e63
commit 53158f6d3c
44 changed files with 267 additions and 209 deletions

View File

@ -37,7 +37,6 @@ module.exports = (phase, { defaultConfig }) => {
BASE_URL,
},
images: {
formats: ["image/webp"],
deviceSizes: [640, 750, 828, 1080, 1200, 1920],
},
experimental: {
@ -48,7 +47,13 @@ module.exports = (phase, { defaultConfig }) => {
config.module.rules.push({
test: /\.svg$/,
issuer: { and: [/\.(js|ts)x?$/] },
include: [path.resolve(__dirname, "components/icons")],
include: [
path.resolve(__dirname, "components/icons"),
// slight workaround to grab svg files from these packages directly instead of through their exports:
path.resolve(__dirname, "node_modules/@primer/octicons/build/svg"),
path.resolve(__dirname, "node_modules/simple-icons/icons"),
path.resolve(__dirname, "node_modules/twemoji/assets/svg"),
],
use: [
{
loader: "@svgr/webpack",