Skip to content

Commit

Permalink
chore: disable source-maps in production (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
vpicone authored May 1, 2020
1 parent 69d3aa2 commit 71f6873
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');

exports.onCreateWebpackConfig = ({ actions }) => {
exports.onCreateWebpackConfig = ({ actions, getConfig }) => {
// Allows importing html files for component code examples
actions.setWebpackConfig({
module: {
Expand All @@ -26,4 +26,11 @@ exports.onCreateWebpackConfig = ({ actions }) => {
},
},
});

// Disable sourcemaps in production
if (getConfig().mode === 'production') {
actions.setWebpackConfig({
devtool: false,
});
}
};

1 comment on commit 71f6873

@vercel
Copy link

@vercel vercel bot commented on 71f6873 May 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.