build(webpack): attach sourcemaps so it helps in debugging

aakansha-sm
Aakansha Doshi 4 years ago
parent 3922ee8c11
commit ec6999554a

@ -2,6 +2,7 @@ const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
const webpack = require("webpack");
module.exports = {
mode: "production",
@ -24,7 +25,16 @@ module.exports = {
{
test: /\.(sa|sc|c)ss$/,
exclude: /node_modules/,
use: ["style-loader", { loader: "css-loader" }, "sass-loader"],
use: [
"style-loader",
{
loader: "css-loader",
options: {
sourceMap: false,
},
},
"sass-loader",
],
},
{
test: /\.(ts|tsx|js|jsx|mjs)$/,
@ -89,6 +99,9 @@ module.exports = {
},
plugins: [
...(process.env.ANALYZER === "true" ? [new BundleAnalyzerPlugin()] : []),
new webpack.SourceMapDevToolPlugin({
filename: "[name].js.map",
}),
],
externals: {
react: {

Loading…
Cancel
Save