Unverified Commit 9b70236b authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[devtools] Bundle for same target as Next.js browser runtime (#90762)

parent 6f763ecf
...@@ -73,7 +73,11 @@ module.exports = ({ dev, ...rest }) => { ...@@ -73,7 +73,11 @@ module.exports = ({ dev, ...rest }) => {
test: /\.(ts|tsx)$/, test: /\.(ts|tsx)$/,
exclude: [/node_modules/], exclude: [/node_modules/],
loader: 'builtin:swc-loader', loader: 'builtin:swc-loader',
/** @type {import('@rspack/core').SwcLoaderOptions} */
options: { options: {
env: {
targets: MODERN_BROWSERSLIST_TARGET,
},
jsc: { jsc: {
parser: { parser: {
syntax: 'typescript', syntax: 'typescript',
......
...@@ -122,10 +122,10 @@ export function deobfuscateModuleId(moduleId: string): string { ...@@ -122,10 +122,10 @@ export function deobfuscateModuleId(moduleId: string): string {
*/ */
export function removeFreeCallWrapper(text: string): string { export function removeFreeCallWrapper(text: string): string {
// Match (0, <ident>.<ident>) patterns anywhere in the text the beginning // Match (0, <ident>.<ident>) patterns anywhere in the text the beginning
// Use Unicode property escapes (\p{ID_Start}, \p{ID_Continue}) for full JS identifier support // Overzealous: accept any non-whitespace member expression after the dot.
// Requires the 'u' (unicode) flag in the regex // TODO: Fix https://linear.app/vercel/issue/NEXT-4875 to allow using unicode property escapes
return text.replace( return text.replace(
/\(0\s*,\s*(__TURBOPACK__[a-zA-Z0-9_$]+__\.[\p{ID_Start}_$][\p{ID_Continue}$]*)\)/u, /\(0\s*,\s*(__TURBOPACK__[a-zA-Z0-9_$]+__\.[^\s)]+)\)/g,
'$1' '$1'
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment