From 44a066fa5784f5d053bb13c626b3732662d17b7b Mon Sep 17 00:00:00 2001 From: David Baumwald Date: Fri, 2 Apr 2021 19:40:43 +0000 Subject: [PATCH] External Libraries: Update Underscore to version 1.12.1. Full set of changes at https://github.com/jashkenas/underscore/compare/1.8.3...1.12.1. The new version includes a `sourceMappingURL` that causes a build failure, so this change also introduces a task to remove this from the source during the build. Props mukesh27, hareesh-pillai, desrosj, SergeyBiryukov, TimoTijhof. Fixes #45785. git-svn-id: https://develop.svn.wordpress.org/trunk@50650 602fd350-edb4-49c9-b593-d223f7449a82 --- Gruntfile.js | 21 +++++++++++++++++++++ package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 62fb44fbd0..6d0d02922f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1126,6 +1126,26 @@ module.exports = function(grunt) { dest: BUILD_DIR + 'wp-includes/' } ] + }, + sourceMaps: { + options: { + patterns: [ + { + match: new RegExp( '//# sourceMappingURL=.*\\s*' ), + replacement: '' + } + ] + }, + files: [ + { + expand: true, + flatten: true, + src: [ + BUILD_DIR + 'wp-includes/js/underscore.js' + ], + dest: BUILD_DIR + 'wp-includes/js/' + } + ] } }, _watch: { @@ -1569,6 +1589,7 @@ module.exports = function(grunt) { 'includes:emoji', 'includes:embed', 'replace:emojiBannerText', + 'replace:sourceMaps', 'verify:build' ] ); } diff --git a/package-lock.json b/package-lock.json index 617197a555..45ab762835 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23053,9 +23053,9 @@ "dev": true }, "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" }, "underscore.string": { "version": "3.3.5", diff --git a/package.json b/package.json index 0441ab0fb3..5be8c4b276 100644 --- a/package.json +++ b/package.json @@ -145,7 +145,7 @@ "react": "16.13.1", "react-dom": "16.13.1", "twemoji": "13.0.2", - "underscore": "1.8.3", + "underscore": "1.12.1", "whatwg-fetch": "3.0.0" }, "scripts": {