diff --git a/package.json b/package.json index 3108751241..8417edc6f6 100644 --- a/package.json +++ b/package.json @@ -273,6 +273,7 @@ "raw-loader": "^4.0.2", "rimraf": "^6.0.0", "semver": "^7.5.2", + "source-map-loader": "^5.0.0", "stylelint": "^16.1.0", "stylelint-config-standard": "^36.0.0", "stylelint-scss": "^6.0.0", diff --git a/webpack.config.js b/webpack.config.js index 14f472a189..0ed4dc3650 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -238,6 +238,9 @@ module.exports = (env, argv) => { }, }, + // Some of our deps have broken source maps, so we have to ignore warnings or exclude them one-by-one + ignoreWarnings: [/Failed to parse source map/], + module: { noParse: [ // for cross platform compatibility use [\\\/] as the path separator @@ -250,6 +253,11 @@ module.exports = (env, argv) => { /highlight\.js[\\/]lib[\\/]languages/, ], rules: [ + { + test: /\.js$/, + enforce: "pre", + use: ["source-map-loader"], + }, { test: /\.(ts|js)x?$/, include: (f) => { diff --git a/yarn.lock b/yarn.lock index 4a20a16be3..b21301342c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6858,7 +6858,7 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@0.6.3, iconv-lite@^0.6: +iconv-lite@0.6.3, iconv-lite@^0.6, 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== @@ -10787,11 +10787,19 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" -source-map-js@^1.0.1, source-map-js@^1.2.0, source-map-js@^1.2.1: +source-map-js@^1.0.1, source-map-js@^1.0.2, source-map-js@^1.2.0, source-map-js@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== +source-map-loader@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-5.0.0.tgz#f593a916e1cc54471cfc8851b905c8a845fc7e38" + integrity sha512-k2Dur7CbSLcAH73sBcIkV5xjPV4SzqO1NJ7+XaQl8if3VODDUj3FNchNGpqgJSKbvUfJuhVdv8K2Eu8/TNl2eA== + dependencies: + iconv-lite "^0.6.3" + source-map-js "^1.0.2" + source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932"