Skip to content

Commit fb95031

Browse files
committed
Don't calculate sourcemaps in production
1 parent bb931e2 commit fb95031

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

webpack.config.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ module.exports = (env, argv) => {
1414
argv.mode = "development";
1515
}
1616

17+
const development = {};
18+
if (argv.mode !== "production") {
19+
// This makes the sourcemaps human readable for developers. We use eval-source-map
20+
// because the plain source-map devtool ruins the alignment.
21+
development['devtool'] = 'eval-source-map';
22+
}
23+
1724
return {
25+
...development,
26+
1827
entry: {
1928
"bundle": "./src/vector/index.js",
2029
"indexeddb-worker": "./src/vector/indexeddb-worker.js",
@@ -301,10 +310,6 @@ module.exports = (env, argv) => {
301310
chunkFilename: "bundles/[hash]/[name].js",
302311
},
303312

304-
// This makes the sourcemaps human readable for developers. We use eval-source-map
305-
// because the plain source-map devtool ruins the alignment.
306-
devtool: "eval-source-map",
307-
308313
// configuration for the webpack-dev-server
309314
devServer: {
310315
// serve unwebpacked assets from webapp.

0 commit comments

Comments
 (0)