Created
April 2, 2020 17:17
-
-
Save twslade/87e7a9228776a4081b40802a5d7fc21b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 path = require("path"); | |
const CopyPlugin = require("copy-webpack-plugin"); | |
module.exports = ({ config }) => { | |
config.plugins.push( | |
new CopyPlugin([ | |
{ from: "stories/static", to: "public/images" }, // Copy static files | |
{ from: "public/static", to: "./static/" } // Copy gatsby generated static files. | |
]) | |
); | |
/** | |
* Add aliases for gatsby images. | |
* Separate types to preserve type safety between Fixed and Fluid images | |
*/ | |
config.resolveLoader = { | |
alias: { | |
"gatsby-image-fixed": path.join(__dirname, "loaders/gatsby-image.js"), | |
"gatsby-image-fluid": path.join(__dirname, "loaders/gatsby-image.js") | |
} | |
}; | |
return config; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment