From 27e454ced805e28425ee51004df365420abffaa8 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 10 Jan 2025 08:54:28 +0100 Subject: [PATCH] chore: fix Typescript issues when using newer vite version Signed-off-by: Ferdinand Thiessen --- lib/appConfig.ts | 3 ++- lib/plugins/CSSEntryPoints.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/appConfig.ts b/lib/appConfig.ts index e512ed9..54e60f1 100644 --- a/lib/appConfig.ts +++ b/lib/appConfig.ts @@ -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' @@ -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' diff --git a/lib/plugins/CSSEntryPoints.ts b/lib/plugins/CSSEntryPoints.ts index d8f4e94..ca0f950 100644 --- a/lib/plugins/CSSEntryPoints.ts +++ b/lib/plugins/CSSEntryPoints.ts @@ -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({