11import path from 'node:path'
22import fs from 'node:fs'
33import type { SFCBlock , SFCDescriptor } from 'vue/compiler-sfc'
4- import type { PluginContext , TransformPluginContext } from 'rollup'
54import type { RawSourceMap } from 'source-map-js'
65import type { EncodedSourceMap as TraceEncodedSourceMap } from '@jridgewell/trace-mapping'
76import { TraceMap , eachMapping } from '@jridgewell/trace-mapping'
87import type { EncodedSourceMap as GenEncodedSourceMap } from '@jridgewell/gen-mapping'
98import { addMapping , fromMap , toEncodedMap } from '@jridgewell/gen-mapping'
9+ import type { Rollup } from 'vite'
1010import { normalizePath , transformWithEsbuild } from 'vite'
1111import {
1212 createDescriptor ,
@@ -31,7 +31,7 @@ export async function transformMain(
3131 code : string ,
3232 filename : string ,
3333 options : ResolvedOptions ,
34- pluginContext : TransformPluginContext ,
34+ pluginContext : Rollup . TransformPluginContext ,
3535 ssr : boolean ,
3636 customElement : boolean ,
3737) {
@@ -290,7 +290,7 @@ export async function transformMain(
290290async function genTemplateCode (
291291 descriptor : SFCDescriptor ,
292292 options : ResolvedOptions ,
293- pluginContext : PluginContext ,
293+ pluginContext : Rollup . PluginContext ,
294294 ssr : boolean ,
295295 customElement : boolean ,
296296) {
@@ -339,7 +339,7 @@ async function genTemplateCode(
339339async function genScriptCode (
340340 descriptor : SFCDescriptor ,
341341 options : ResolvedOptions ,
342- pluginContext : PluginContext ,
342+ pluginContext : Rollup . PluginContext ,
343343 ssr : boolean ,
344344 customElement : boolean ,
345345) : Promise < {
@@ -397,7 +397,7 @@ async function genScriptCode(
397397
398398async function genStyleCode (
399399 descriptor : SFCDescriptor ,
400- pluginContext : PluginContext ,
400+ pluginContext : Rollup . PluginContext ,
401401 customElement : boolean ,
402402 attachedProps : [ string , string ] [ ] ,
403403) {
@@ -487,7 +487,7 @@ function genCSSModulesCode(
487487
488488async function genCustomBlockCode (
489489 descriptor : SFCDescriptor ,
490- pluginContext : PluginContext ,
490+ pluginContext : Rollup . PluginContext ,
491491) {
492492 let code = ''
493493 for ( let index = 0 ; index < descriptor . customBlocks . length ; index ++ ) {
@@ -514,7 +514,7 @@ async function genCustomBlockCode(
514514async function linkSrcToDescriptor (
515515 src : string ,
516516 descriptor : SFCDescriptor ,
517- pluginContext : PluginContext ,
517+ pluginContext : Rollup . PluginContext ,
518518 scoped ?: boolean ,
519519) {
520520 const srcFile =
0 commit comments