Skip to content

Commit

Permalink
chore: fix Typescript issues when using newer vite version
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Jan 10, 2025
1 parent 1e04fd3 commit 27e454c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import type { Plugin, UserConfig, UserConfigFn } from 'vite'
import type { BaseOptions, NodePolyfillsOptions } from './baseConfig.js'
import type { EmptyJSDirPluginOptions } from './plugins/EmptyJSDir.js'

import { readFileSync } from 'node:fs'
import { relative } from 'node:path'
Expand All @@ -14,7 +15,7 @@ import { mergeConfig } from 'vite'
import { createBaseConfig } from './baseConfig.js'
import { findAppinfo } from './utils/appinfo.js'

import EmptyJSDirPlugin, { EmptyJSDirPluginOptions } from './plugins/EmptyJSDir.js'
import EmptyJSDirPlugin from './plugins/EmptyJSDir.js'
import replace from '@rollup/plugin-replace'
import injectCSSPlugin from 'vite-plugin-css-injected-by-js'
import { CSSEntryPointsPlugin } from './plugins/CSSEntryPoints.js'
Expand Down
9 changes: 8 additions & 1 deletion lib/plugins/CSSEntryPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,14 @@ export function CSSEntryPointsPlugin(options?: CSSEntryPointsPluginOptions) {
const path = dirname(
typeof options.assetFileNames === 'string'
? options.assetFileNames
: options.assetFileNames({ type: 'asset', source: '', name: 'name.css' })
: options.assetFileNames({
type: 'asset',
source: '',
name: 'name.css',
names: ['name.css'],
originalFileName: null,
originalFileNames: [],
}),
)

this.emitFile({
Expand Down

0 comments on commit 27e454c

Please sign in to comment.