Skip to content

Instantly share code, notes, and snippets.

@twslade
Created April 2, 2020 17:17
Show Gist options
  • Save twslade/87e7a9228776a4081b40802a5d7fc21b to your computer and use it in GitHub Desktop.
Save twslade/87e7a9228776a4081b40802a5d7fc21b to your computer and use it in GitHub Desktop.
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