Skip to content

Instantly share code, notes, and snippets.

@siakaramalegos
Last active August 21, 2018 21:07
Show Gist options
  • Save siakaramalegos/b5e3b1bbdd87f5f8bba193fc26169a4c to your computer and use it in GitHub Desktop.
Save siakaramalegos/b5e3b1bbdd87f5f8bba193fc26169a4c to your computer and use it in GitHub Desktop.
Disable source maps in production build using Gatsby v2
exports.onCreateWebpackConfig = ({ actions, stage }) => {
// If production JavaScript and CSS build
if (stage === 'build-javascript') {
// Turn off source maps
actions.setWebpackConfig({
devtool: false,
})
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment