File tree Expand file tree Collapse file tree 4 files changed +640
-558
lines changed Expand file tree Collapse file tree 4 files changed +640
-558
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ import {
6969} from '../utils'
7070import type { Logger } from '../logger'
7171import { cleanUrl , slash } from '../../shared/utils'
72+ import type { TransformPluginContext } from '../server/pluginContainer'
7273import { addToHTMLProxyTransformResult } from './html'
7374import {
7475 assetUrlRE ,
@@ -969,9 +970,8 @@ export function cssAnalysisPlugin(config: ResolvedConfig): Plugin {
969970 ! inlineRE . test ( id ) &&
970971 ! htmlProxyRE . test ( id )
971972 // attached by pluginContainer.addWatchFile
972- const pluginImports = ( this as any ) . _addedImports as
973- | Set < string >
974- | undefined
973+ const pluginImports = ( this as unknown as TransformPluginContext )
974+ . _addedImports
975975 if ( pluginImports ) {
976976 // record deps in the module graph so edits to @import css can trigger
977977 // main import to hot update
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ import {
6363 withTrailingSlash ,
6464 wrapId ,
6565} from '../../shared/utils'
66+ import type { TransformPluginContext } from '../server/pluginContainer'
6667import { throwOutdatedRequest } from './optimizedDeps'
6768import { isCSSRequest , isDirectCSSRequest } from './css'
6869import { browserExternalId } from './resolve'
@@ -253,7 +254,10 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
253254 throwOutdatedRequest ( importer )
254255 }
255256
256- if ( ! imports . length && ! ( this as any ) . _addedImports ) {
257+ if (
258+ ! imports . length &&
259+ ! ( this as unknown as TransformPluginContext ) . _addedImports
260+ ) {
257261 importerModule . isSelfAccepting = false
258262 debug ?.(
259263 `${ timeFrom ( msAtStart ) } ${ colors . dim (
@@ -747,9 +751,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
747751 // note that we want to handle .css?raw and .css?url here
748752 if ( ! isCSSRequest ( importer ) || SPECIAL_QUERY_RE . test ( importer ) ) {
749753 // attached by pluginContainer.addWatchFile
750- const pluginImports = ( this as any ) . _addedImports as
751- | Set < string >
752- | undefined
754+ const pluginImports = ( this as unknown as TransformPluginContext )
755+ . _addedImports
753756 if ( pluginImports ) {
754757 ; (
755758 await Promise . all (
You can’t perform that action at this time.
0 commit comments