Skip to content

Commit 5720ce3

Browse files
committed
fix(player/react): unexpected token { in iOS<17
1 parent ae68595 commit 5720ce3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

packages/react/rollup.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url';
33

44
import { nodeResolve } from '@rollup/plugin-node-resolve';
55
import chokidar from 'chokidar';
6-
import { build } from 'esbuild';
6+
import { build, transform as esbuildTransform } from 'esbuild';
77
import fs from 'fs-extra';
88
import { globbySync } from 'globby';
99
import { defineConfig } from 'rollup';
@@ -164,6 +164,17 @@ function define({ dev }) {
164164
__DEV__: dev ? 'true' : 'false',
165165
},
166166
}),
167+
{
168+
name: 'target-syntax',
169+
transform(code, id) {
170+
if (/node_modules.*?\.js/.test(id)) {
171+
return esbuildTransform(code, {
172+
target: 'es2021',
173+
platform: 'browser',
174+
}).then((t) => t.code);
175+
}
176+
},
177+
},
167178
{
168179
name: 'rsc-directives',
169180
resolveId(id) {

0 commit comments

Comments
 (0)