1
1
import path from 'node:path'
2
2
import fs from 'node:fs'
3
3
import type { SFCBlock , SFCDescriptor } from 'vue/compiler-sfc'
4
- import type { PluginContext , TransformPluginContext } from 'rollup'
5
4
import type { RawSourceMap } from 'source-map-js'
6
5
import type { EncodedSourceMap as TraceEncodedSourceMap } from '@jridgewell/trace-mapping'
7
6
import { TraceMap , eachMapping } from '@jridgewell/trace-mapping'
8
7
import type { EncodedSourceMap as GenEncodedSourceMap } from '@jridgewell/gen-mapping'
9
8
import { addMapping , fromMap , toEncodedMap } from '@jridgewell/gen-mapping'
9
+ import type { Rollup } from 'vite'
10
10
import { normalizePath , transformWithEsbuild } from 'vite'
11
11
import {
12
12
createDescriptor ,
@@ -31,7 +31,7 @@ export async function transformMain(
31
31
code : string ,
32
32
filename : string ,
33
33
options : ResolvedOptions ,
34
- pluginContext : TransformPluginContext ,
34
+ pluginContext : Rollup . TransformPluginContext ,
35
35
ssr : boolean ,
36
36
customElement : boolean ,
37
37
) {
@@ -290,7 +290,7 @@ export async function transformMain(
290
290
async function genTemplateCode (
291
291
descriptor : SFCDescriptor ,
292
292
options : ResolvedOptions ,
293
- pluginContext : PluginContext ,
293
+ pluginContext : Rollup . PluginContext ,
294
294
ssr : boolean ,
295
295
customElement : boolean ,
296
296
) {
@@ -339,7 +339,7 @@ async function genTemplateCode(
339
339
async function genScriptCode (
340
340
descriptor : SFCDescriptor ,
341
341
options : ResolvedOptions ,
342
- pluginContext : PluginContext ,
342
+ pluginContext : Rollup . PluginContext ,
343
343
ssr : boolean ,
344
344
customElement : boolean ,
345
345
) : Promise < {
@@ -397,7 +397,7 @@ async function genScriptCode(
397
397
398
398
async function genStyleCode (
399
399
descriptor : SFCDescriptor ,
400
- pluginContext : PluginContext ,
400
+ pluginContext : Rollup . PluginContext ,
401
401
customElement : boolean ,
402
402
attachedProps : [ string , string ] [ ] ,
403
403
) {
@@ -487,7 +487,7 @@ function genCSSModulesCode(
487
487
488
488
async function genCustomBlockCode (
489
489
descriptor : SFCDescriptor ,
490
- pluginContext : PluginContext ,
490
+ pluginContext : Rollup . PluginContext ,
491
491
) {
492
492
let code = ''
493
493
for ( let index = 0 ; index < descriptor . customBlocks . length ; index ++ ) {
@@ -514,7 +514,7 @@ async function genCustomBlockCode(
514
514
async function linkSrcToDescriptor (
515
515
src : string ,
516
516
descriptor : SFCDescriptor ,
517
- pluginContext : PluginContext ,
517
+ pluginContext : Rollup . PluginContext ,
518
518
scoped ?: boolean ,
519
519
) {
520
520
const srcFile =
0 commit comments