@@ -21,8 +21,6 @@ import {
2121 checkVuePlugin ,
2222 error ,
2323 getVitePlugin ,
24- getVitePluginTransform ,
25- overrideVitePluginTransform ,
2624 raiseError ,
2725 resolveNamespace ,
2826 warn
@@ -138,24 +136,11 @@ export function resourcePlugin(
138136 `configResolved: isProduction = ${ isProduction } , sourceMap = ${ sourceMap } `
139137 )
140138
141- /**
142- * NOTE:
143- * For the native rolldown plugin, we need to change to another solution from the current workaround.
144- * Currently, the rolldown team and vite team are discussing this issue.
145- * https://github.com/vitejs/rolldown-vite/issues/120
146- */
147-
148139 // json transform handling
149140 const jsonPlugin = getVitePlugin ( config , 'vite:json' )
150141 if ( jsonPlugin ) {
151- // saving `vite:json` plugin instance
152- const [ orgTransform , transformWay ] =
153- getVitePluginTransform ( jsonPlugin )
154- if ( ! orgTransform ) {
155- throw new Error ( 'vite:json plugin not found!' )
156- }
157-
158- async function overrideViteJsonPlugin ( code : string , id : string ) {
142+ const orgTransform = jsonPlugin . transform // backup @rollup /plugin-json
143+ jsonPlugin . transform = async function ( code : string , id : string ) {
159144 if ( ! / \. j s o n $ / . test ( id ) || filter ( id ) ) {
160145 return
161146 }
@@ -177,13 +162,6 @@ export function resourcePlugin(
177162 // @ts -expect-error
178163 return orgTransform ! . apply ( this , [ code , id ] )
179164 }
180-
181- // override `vite:json` plugin transform function
182- overrideVitePluginTransform (
183- jsonPlugin ,
184- overrideViteJsonPlugin ,
185- transformWay !
186- )
187165 }
188166
189167 /**
0 commit comments