From badff2d1d63ad592aea63a47eacf07f17cc6e968 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 11 Feb 2022 18:02:04 +0800 Subject: [PATCH] Update `esm-utils` to v3 (#12274) --- package.json | 2 +- scripts/build/bundler.mjs | 4 ++-- yarn.lock | 15 +++++++++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a4afae3ee..d1c38b79c 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "eslint-plugin-react": "7.28.0", "eslint-plugin-regexp": "1.5.1", "eslint-plugin-unicorn": "40.1.0", - "esm-utils": "2.0.1", + "esm-utils": "3.0.0", "execa": "5.1.1", "jest": "27.5.0", "jest-snapshot-serializer-ansi": "1.0.0", diff --git a/scripts/build/bundler.mjs b/scripts/build/bundler.mjs index 180eccea9..dd358401c 100644 --- a/scripts/build/bundler.mjs +++ b/scripts/build/bundler.mjs @@ -15,8 +15,8 @@ import esbuildPluginUmd from "./esbuild-plugins/umd.mjs"; import esbuildPluginVisualizer from "./esbuild-plugins/visualizer.mjs"; import bundles from "./config.mjs"; -const { __dirname, json, require } = createEsmUtils(import.meta); -const packageJson = json.loadSync("../../package.json"); +const { __dirname, readJsonSync, require } = createEsmUtils(import.meta); +const packageJson = readJsonSync("../../package.json"); const umdTarget = browserslistToEsbuild(packageJson.browserslist); const EMPTY_MODULE_REPLACEMENT = { contents: "" }; diff --git a/yarn.lock b/yarn.lock index 94f90f354..1af1e4568 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3074,10 +3074,12 @@ eslint@8.8.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" -esm-utils@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/esm-utils/-/esm-utils-2.0.1.tgz#233b691b5542cafdc3a6f4b24bd4af083ea21bd0" - integrity sha512-eoz4dzSzykeh9mfRlCDTkNezD2zlPdFftiTH/5OZpE08hGpUPljh5rHDZqucIhX1Wl4cO6FDUUBp3tobvV7dWA== +esm-utils@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/esm-utils/-/esm-utils-3.0.0.tgz#dacf1b3928da7c651982221c4d59710475cf0b93" + integrity sha512-BRGUeZ4BktoVZE8mhA/zVb6YD9Hc7sW6lidTDFgj+a+ugu/e6uDCifKUNAXUv0eEQeIvb6juSVOZ71Rv99bL8w== + dependencies: + url-or-path "2.1.0" espree@9.3.0, espree@^9.2.0, espree@^9.3.0: version "9.3.0" @@ -6307,6 +6309,11 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +url-or-path@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/url-or-path/-/url-or-path-2.1.0.tgz#8bb39a2a2b7e8f2e31c7883d8207b0cbd07acb9f" + integrity sha512-dsBD6GbytSMj9YDb3jVzSRENwFh50oUORnWBeSHfo0Lnwv2KMm/J4npyGy1P9rivUPsUGLjTA53XqAFqpe0nww== + v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"