Skip to content

Commit

Permalink
Refactor(webpack): enable sourcempa for SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Apr 25, 2021
1 parent 435edd0 commit 903edcf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-cool-starter",
"version": "4.3.0",
"version": "4.3.1",
"private": true,
"description": "A starter boilerplate for a universal web application with the best development experience and best practices.",
"license": "MIT",
Expand Down
19 changes: 7 additions & 12 deletions webpack/server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ import merge from "webpack-merge";

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

const getPlugins = () =>
isDev
? [
// Adding source map support to node.js (for stack traces)
new webpack.BannerPlugin({
banner: 'require("source-map-support").install();',
raw: true,
}),
]
: [];

const config: Configuration = {
target: "node",
devtool: isDev ? "inline-source-map" : "source-map",
Expand All @@ -34,7 +23,13 @@ const config: Configuration = {
allowlist: [/\.(?!(?:jsx?|json)$).{1,5}$/i],
}),
],
plugins: getPlugins(),
plugins: [
// Adding source map support to node.js (for stack traces)
new webpack.BannerPlugin({
banner: 'require("source-map-support").install();',
raw: true,
}),
],
};

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

0 comments on commit 903edcf

Please sign in to comment.