Skip to content

Commit

Permalink
fix source maps are mess in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lihsai0 committed Jan 25, 2022
1 parent 154877a commit 6baadb2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"mock-fs": "^5.1.1",
"npm": "^6.13.4",
"npm-run-all": "^4.1.3",
"source-map-loader": "^3.0.0",
"source-map-loader": "^3.0.1",
"ts-jest": "^27.0.7",
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
]
},
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"sourceMap": true
},
"exclude": [
"node_modules",
Expand Down
8 changes: 8 additions & 0 deletions webpack/webpack-renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ module.exports = function(webpackEnv) {
],
module: {
rules: [
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
},
{ test: /\.ts$/, loader: "ts-loader" },
{
test: /\.css$/i,
Expand Down Expand Up @@ -124,5 +129,8 @@ module.exports = function(webpackEnv) {
},
minimize: isEnvProduction,
},
ignoreWarnings: [
/Failed to parse source map/,
],
}
}
24 changes: 18 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5700,6 +5700,13 @@ iconv-lite@^0.6.2:
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"

iconv-lite@^0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"

icss-utils@^5.0.0, icss-utils@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"
Expand Down Expand Up @@ -10121,14 +10128,19 @@ source-map-js@^0.6.2:
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e"
integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==

source-map-loader@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-3.0.0.tgz#f2a04ee2808ad01c774dea6b7d2639839f3b3049"
integrity sha512-GKGWqWvYr04M7tn8dryIWvb0s8YM41z82iQv01yBtIylgxax0CwvSy6gc2Y02iuXwEfGWRlMicH0nvms9UZphw==
source-map-js@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==

source-map-loader@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-3.0.1.tgz#9ae5edc7c2d42570934be4c95d1ccc6352eba52d"
integrity sha512-Vp1UsfyPvgujKQzi4pyDiTOnE3E4H+yHvkVRN3c/9PJmQS4CQJExvcDvaX/D+RV+xQben9HJ56jMJS3CgUeWyA==
dependencies:
abab "^2.0.5"
iconv-lite "^0.6.2"
source-map-js "^0.6.2"
iconv-lite "^0.6.3"
source-map-js "^1.0.1"

source-map-resolve@^0.5.0:
version "0.5.3"
Expand Down

0 comments on commit 6baadb2

Please sign in to comment.