Skip to content

Commit

Permalink
Create source maps only in development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed May 15, 2019
1 parent 4006718 commit 0335c2d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require("path");
const webpack = require("webpack");

const mode = process.env.NODE_ENV === "production" ? "production" : "development";
const devtool = process.env.NODE_ENV === "production" ? undefined : "source-map";

console.log(`Using "${mode}" mode for webpack bundles`);

Expand All @@ -25,7 +26,7 @@ const mainConfig = {
mode,
target: "electron-main",
node: false,
devtool: "source-map"
devtool,
}

const rendererConfig = {
Expand All @@ -51,14 +52,7 @@ const rendererConfig = {
mode,
target: "electron-renderer",
node: false,
devtool: "source-map",
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: '"production"'
}
})
]
devtool,
};

module.exports = [
Expand Down

0 comments on commit 0335c2d

Please sign in to comment.