File tree Expand file tree Collapse file tree 7 files changed +193
-234
lines changed Expand file tree Collapse file tree 7 files changed +193
-234
lines changed Original file line number Diff line number Diff line change 6868 "playwright-chromium" : " ^1.50.1" ,
6969 "premove" : " ^4.0.0" ,
7070 "prettier" : " 3.5.3" ,
71- "rollup" : " ^4.30.1 " ,
71+ "rollup" : " ^4.34.9 " ,
7272 "rollup-plugin-esbuild" : " ^6.2.1" ,
7373 "simple-git-hooks" : " ^2.11.1" ,
7474 "tslib" : " ^2.8.1" ,
Original file line number Diff line number Diff line change 8787 "dependencies" : {
8888 "esbuild" : " ^0.25.0" ,
8989 "postcss" : " ^8.5.3" ,
90- "rollup" : " ^4.30.1 "
90+ "rollup" : " ^4.34.9 "
9191 },
9292 "optionalDependencies" : {
9393 "fsevents" : " ~2.3.3"
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export type {
205205 GeneralImportGlobOptions ,
206206 KnownAsTypeMap ,
207207} from 'types/importGlob'
208- export type { ChunkMetadata } from 'types/metadata'
208+ export type { ChunkMetadata , CustomPluginOptionsVite } from 'types/metadata'
209209
210210// dep types
211211export type {
Original file line number Diff line number Diff line change @@ -323,24 +323,6 @@ export interface Plugin<A = any> extends RollupPlugin<A> {
323323 >
324324}
325325
326- export interface CustomPluginOptionsVite {
327- /**
328- * If this is a CSS Rollup module, you can scope to its importer's exports
329- * so that if those exports are treeshaken away, the CSS module will also
330- * be treeshaken.
331- *
332- * The "importerId" must import the CSS Rollup module statically.
333- *
334- * Example config if the CSS id is `/src/App.vue?vue&type=style&lang.css`:
335- * ```js
336- * cssScopeTo: ['/src/App.vue', 'default']
337- * ```
338- *
339- * @experimental
340- */
341- cssScopeTo ?: [ importerId : string , exportName : string | undefined ]
342- }
343-
344326export type HookHandler < T > = T extends ObjectHook < infer H > ? H : T
345327
346328export type PluginWithRequiredHook < K extends keyof Plugin > = Plugin & {
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import type {
3737 TransformAttributeResult as LightningCssTransformAttributeResult ,
3838 TransformResult as LightningCssTransformResult ,
3939} from 'lightningcss'
40+ import type { CustomPluginOptionsVite } from 'types/metadata'
4041import { getCodeWithSourcemap , injectSourcesContent } from '../server/sourcemap'
4142import type { EnvironmentModuleNode } from '../server/moduleGraph'
4243import {
@@ -54,7 +55,7 @@ import {
5455 SPECIAL_QUERY_RE ,
5556} from '../constants'
5657import type { ResolvedConfig } from '../config'
57- import type { CustomPluginOptionsVite , Plugin } from '../plugin'
58+ import type { Plugin } from '../plugin'
5859import { checkPublicFile } from '../publicDir'
5960import {
6061 arraify ,
@@ -650,11 +651,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
650651 // NOTE: `this.getModuleInfo` can be undefined when the plugin is called directly
651652 // adding `?.` temporary to avoid unocss from breaking
652653 // TODO: remove `?.` after `this.getModuleInfo` in Vite 7
653- (
654- this . getModuleInfo ?.( id ) ?. meta ?. vite as
655- | CustomPluginOptionsVite
656- | undefined
657- ) ?. cssScopeTo
654+ this . getModuleInfo ?.( id ) ?. meta ?. vite ?. cssScopeTo
658655
659656 // record css
660657 if ( ! inlined ) {
Original file line number Diff line number Diff line change @@ -3,8 +3,30 @@ export interface ChunkMetadata {
33 importedCss : Set < string >
44}
55
6+ export interface CustomPluginOptionsVite {
7+ /**
8+ * If this is a CSS Rollup module, you can scope to its importer's exports
9+ * so that if those exports are treeshaken away, the CSS module will also
10+ * be treeshaken.
11+ *
12+ * The "importerId" must import the CSS Rollup module statically.
13+ *
14+ * Example config if the CSS id is `/src/App.vue?vue&type=style&lang.css`:
15+ * ```js
16+ * cssScopeTo: ['/src/App.vue', 'default']
17+ * ```
18+ *
19+ * @experimental
20+ */
21+ cssScopeTo ?: [ importerId : string , exportName : string | undefined ]
22+ }
23+
624declare module 'rollup' {
725 export interface RenderedChunk {
826 viteMetadata ?: ChunkMetadata
927 }
28+
29+ export interface CustomPluginOptions {
30+ vite ?: CustomPluginOptionsVite
31+ }
1032}
You can’t perform that action at this time.
0 commit comments