File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
playground/environment-react-ssr Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717 asyncFlatten ,
1818 createDebugger ,
1919 dataUrlRE ,
20+ deepClone ,
2021 externalRE ,
2122 isInNodeModules ,
2223 isObject ,
@@ -263,19 +264,20 @@ async function prepareRolldownScanner(
263264 const { tsconfig } = await loadTsconfigJsonForFile (
264265 path . join ( environment . config . root , '_dummy.js' ) ,
265266 )
266- rollupOptions . transform ??= { }
267+ const transformOptions = deepClone ( rollupOptions . transform ) ?? { }
267268 setOxcTransformOptionsFromTsconfigOptions (
268- rollupOptions . transform ,
269+ transformOptions ,
269270 tsconfig . compilerOptions ,
270271 [ ] , // NOTE: ignore warnings as the same warning will be shown by the plugin container
271272 )
272- if ( typeof rollupOptions . transform . jsx === 'object' ) {
273- rollupOptions . transform . jsx . development ??= ! environment . config . isProduction
273+ if ( typeof transformOptions . jsx === 'object' ) {
274+ transformOptions . jsx . development ??= ! environment . config . isProduction
274275 }
275276
276277 async function build ( ) {
277278 await scan ( {
278279 ...rollupOptions ,
280+ transform : transformOptions ,
279281 input : entries ,
280282 logLevel : 'silent' ,
281283 plugins,
Original file line number Diff line number Diff line change @@ -1166,7 +1166,7 @@ type DeepWritable<T> =
11661166 ? T
11671167 : { - readonly [ P in keyof T ] : DeepWritable < T [ P ] > }
11681168
1169- function deepClone < T > ( value : T ) : DeepWritable < T > {
1169+ export function deepClone < T > ( value : T ) : DeepWritable < T > {
11701170 if ( Array . isArray ( value ) ) {
11711171 return value . map ( ( v ) => deepClone ( v ) ) as DeepWritable < T >
11721172 }
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ export default defineConfig((env) => ({
3737 sourcemap : true ,
3838 outDir : 'dist/client' ,
3939 } ,
40+ optimizeDeps : {
41+ rolldownOptions : {
42+ // manual test for https://github.com/vitejs/rolldown-vite/issues/416
43+ transform : { } ,
44+ } ,
45+ } ,
4046 } ,
4147 ssr : {
4248 optimizeDeps : {
You can’t perform that action at this time.
0 commit comments