diff --git a/code/builders/builder-vite/src/optimizeDeps.ts b/code/builders/builder-vite/src/optimizeDeps.ts index 30666008f3b..747aabddd86 100644 --- a/code/builders/builder-vite/src/optimizeDeps.ts +++ b/code/builders/builder-vite/src/optimizeDeps.ts @@ -71,7 +71,6 @@ const INCLUDE_CANDIDATES = [ 'fast-deep-equal', 'html-tags', 'isobject', - 'jsdoc-type-pratt-parser', // TODO: Remove this once it's converted to ESM: https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/173 'loader-utils', 'lodash/camelCase.js', 'lodash/camelCase', diff --git a/code/core/package.json b/code/core/package.json index b0572cdbe1b..b3fd650a1f9 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -511,7 +511,6 @@ "better-opn": "^3.0.2", "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0", "esbuild-register": "^3.5.0", - "jsdoc-type-pratt-parser": "^4.0.0", "polished": "^4.2.2", "recast": "^0.23.5", "semver": "^7.6.2", @@ -599,6 +598,7 @@ "globby": "^14.0.1", "jiti": "^1.21.6", "js-yaml": "^4.1.0", + "jsdoc-type-pratt-parser": "^4.0.0", "lazy-universal-dotenv": "^4.0.0", "leven": "^4.0.0", "markdown-to-jsx": "^7.7.2", diff --git a/code/core/scripts/prep.ts b/code/core/scripts/prep.ts index 04bc1d41cb2..552cc9fa058 100644 --- a/code/core/scripts/prep.ts +++ b/code/core/scripts/prep.ts @@ -106,6 +106,17 @@ async function run() { outdir: 'dist', sourcemap: false, treeShaking: true, + supported: { + // This is an ES2018 feature, but esbuild is really strict here. + // Since not all browser support the latest Unicode characters. + // + // Also this feature only works in combination with a Regex polyfill that we don't load. + // + // The Hermes engine of React Native doesn't support this feature, + // but leaving the regex alone, actually allows Hermes to do its own thing, + // without us having to load a RegExp polyfill. + 'regexp-unicode-property-escapes': true, + }, } satisfies EsbuildContextOptions; const browserEsbuildOptions = {