Skip to content

Commit 903edcf

Browse files
committed
Refactor(webpack): enable sourcempa for SSR
1 parent 435edd0 commit 903edcf

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-cool-starter",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"private": true,
55
"description": "A starter boilerplate for a universal web application with the best development experience and best practices.",
66
"license": "MIT",

webpack/server.config.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@ import merge from "webpack-merge";
55

66
import baseConfig, { isDev } from "./base.config";
77

8-
const getPlugins = () =>
9-
isDev
10-
? [
11-
// Adding source map support to node.js (for stack traces)
12-
new webpack.BannerPlugin({
13-
banner: 'require("source-map-support").install();',
14-
raw: true,
15-
}),
16-
]
17-
: [];
18-
198
const config: Configuration = {
209
target: "node",
2110
devtool: isDev ? "inline-source-map" : "source-map",
@@ -34,7 +23,13 @@ const config: Configuration = {
3423
allowlist: [/\.(?!(?:jsx?|json)$).{1,5}$/i],
3524
}),
3625
],
37-
plugins: getPlugins(),
26+
plugins: [
27+
// Adding source map support to node.js (for stack traces)
28+
new webpack.BannerPlugin({
29+
banner: 'require("source-map-support").install();',
30+
raw: true,
31+
}),
32+
],
3833
};
3934

4035
export default merge(baseConfig(false), config);

0 commit comments

Comments
 (0)