Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,8 @@ async function compileCSS(
postcssPlugins.unshift(
(await import('postcss-modules')).default({
...modulesOptions,
// TODO: convert null to undefined (`null` should be removed from `CSSModulesOptions.localsConvention`)
localsConvention: modulesOptions?.localsConvention ?? undefined,
getJSON(
cssFileName: string,
_modules: Record<string, string>,
Expand Down
55 changes: 0 additions & 55 deletions packages/vite/src/types/shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ declare module 'cors' {
export = cors
}

declare module 'selfsigned' {
export function generate(attrs: any, options: any, done?: any): any
}

declare module 'http-proxy' {
const proxy: any
export = proxy
Expand All @@ -27,18 +23,6 @@ declare module 'launch-editor-middleware' {
export = plugin
}

declare module 'postcss-load-config' {
import type { Plugin, ProcessOptions } from 'postcss'
function load(
inline: any,
root: string
): Promise<{
options: ProcessOptions
plugins: Plugin[]
}>
export = load
}

declare module 'postcss-import' {
import type { Plugin } from 'postcss'
const plugin: (options: {
Expand All @@ -52,45 +36,6 @@ declare module 'postcss-import' {
export = plugin
}

declare module 'postcss-modules' {
import type { Plugin } from 'postcss'
const plugin: (options: any) => Plugin
export = plugin
}

declare module '@rollup/plugin-dynamic-import-vars' {
import type { Plugin } from 'rollup'
import type { BaseNode } from 'estree'

interface Options {
include?: string | RegExp | (string | RegExp)[]
exclude?: string | RegExp | (string | RegExp)[]
warnOnError?: boolean
}

const p: (o?: Options) => Plugin
export default p
export function dynamicImportToGlob(
ast: BaseNode,
source: string
): null | string
}
Comment on lines -61 to -77

@sapphi-red sapphi-red Oct 31, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this existed. But it seems this isn't necessary.


declare module 'rollup-plugin-web-worker-loader' {
import type { Plugin } from 'rollup'

interface Options {
targetPlatform?: string
pattern?: RegExp
extensions?: string[]
sourcemap?: boolean
inline?: boolean
}

const p: (o?: Options) => Plugin
export default p
}

// LESS' types somewhat references this which doesn't make sense in Node,
// so we have to shim it
declare interface HTMLLinkElement {}