@@ -15,16 +15,7 @@ import { createHash } from 'node:crypto'
15
15
import fs from 'node:fs'
16
16
import { dirname , parse as parsePath , resolve } from 'node:path'
17
17
import { parse } from 'vue/compiler-sfc'
18
- import {
19
- checkVuePlugin ,
20
- error ,
21
- getVitePlugin ,
22
- getVitePluginTransform ,
23
- overrideVitePluginTransform ,
24
- raiseError ,
25
- resolveNamespace ,
26
- warn
27
- } from '../utils'
18
+ import { checkVuePlugin , error , getVitePlugin , raiseError , resolveNamespace , warn } from '../utils'
28
19
import { getVueCompiler , parseVueRequest } from '../vue'
29
20
30
21
import type { CodeGenOptions , CodeGenResult } from '@intlify/bundle-utils'
@@ -178,23 +169,12 @@ export function resourcePlugin(opts: ResolvedOptions, meta: UnpluginContextMeta)
178
169
ctx . sourceMap = config . command === 'build' ? ! ! config . build . sourcemap : false
179
170
debug ( `configResolved: isProduction = ${ ctx . prod } , sourceMap = ${ ctx . sourceMap } ` )
180
171
181
- /**
182
- * NOTE:
183
- * For the native rolldown plugin, we need to change to another solution from the current workaround.
184
- * Currently, the rolldown team and vite team are discussing this issue.
185
- * https://github.com/vitejs/rolldown-vite/issues/120
186
- */
187
-
188
172
// json transform handling
189
173
const jsonPlugin = getVitePlugin ( config , 'vite:json' )
190
174
if ( jsonPlugin ) {
191
- // saving `vite:json` plugin instance
192
- const [ orgTransform , transformWay ] = getVitePluginTransform ( jsonPlugin )
193
- if ( ! orgTransform ) {
194
- throw new Error ( 'vite:json plugin not found!' )
195
- }
196
-
197
- async function overrideViteJsonPlugin ( code : string , id : string ) {
175
+ // backup @rollup /plugin-json
176
+ const orgTransform = jsonPlugin . transform
177
+ jsonPlugin . transform = async function ( code : string , id : string ) {
198
178
if ( ! / \. j s o n $ / . test ( id ) || filter ( id ) ) {
199
179
return
200
180
}
@@ -216,9 +196,6 @@ export function resourcePlugin(opts: ResolvedOptions, meta: UnpluginContextMeta)
216
196
// @ts -expect-error
217
197
return orgTransform ! . apply ( this , [ code , id ] )
218
198
}
219
-
220
- // override `vite:json` plugin transform function
221
- overrideVitePluginTransform ( jsonPlugin , overrideViteJsonPlugin , transformWay ! )
222
199
}
223
200
}
224
201
} ,
0 commit comments