Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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