Skip to content

Commit

Permalink
fix(player/react): unexpected token { in iOS<17
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Dec 15, 2023
1 parent ae68595 commit 5720ce3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url';

import { nodeResolve } from '@rollup/plugin-node-resolve';
import chokidar from 'chokidar';
import { build } from 'esbuild';
import { build, transform as esbuildTransform } from 'esbuild';
import fs from 'fs-extra';
import { globbySync } from 'globby';
import { defineConfig } from 'rollup';
Expand Down Expand Up @@ -164,6 +164,17 @@ function define({ dev }) {
__DEV__: dev ? 'true' : 'false',
},
}),
{
name: 'target-syntax',
transform(code, id) {
if (/node_modules.*?\.js/.test(id)) {
return esbuildTransform(code, {
target: 'es2021',
platform: 'browser',
}).then((t) => t.code);
}
},
},
{
name: 'rsc-directives',
resolveId(id) {
Expand Down

0 comments on commit 5720ce3

Please sign in to comment.