Skip to content

Commit

Permalink
fix: change svg build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
lnikell committed May 4, 2021
1 parent e22a44d commit 9f83767
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const defaultUrlSvgOptions = [
{
test: /\.svg$/,
svgo: true,
name: "static/[name]-[hash].[ext]",
limit: 512,
},
];

Expand All @@ -22,6 +24,13 @@ exports.onCreateWebpackConfig = (
const { replaceWebpackConfig, setWebpackConfig } = actions;
const existingConfig = getConfig();

if (!urlSvgOptions.name) {
urlSvgOptions.name = "static/[name]-[hash].[ext]";
}
if (!urlSvgOptions.limit) {
urlSvgOptions.limit = 512;
}

// Run only for the specificified build stages
if (
["develop", "develop-html", "build-html", "build-javascript"].includes(
Expand Down

0 comments on commit 9f83767

Please sign in to comment.