Skip to content

Commit 95841ed

Browse files
committed
fix: add back inlined function to please ts
1 parent 0f7c13d commit 95841ed

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/vite-plugin-svelte/src/preprocess.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ async function createCssTransform(style, config) {
100100
if (style.__resolvedConfig) {
101101
// @ts-expect-error
102102
resolvedConfig = style.__resolvedConfig;
103-
} else if (config.inlineConfig != null) {
104-
// passed config is already resolved
103+
} else if (isResolvedConfig(config)) {
105104
resolvedConfig = config;
106105
} else {
107106
resolvedConfig = await resolveConfig(
@@ -113,3 +112,11 @@ async function createCssTransform(style, config) {
113112
return preprocessCSS(code, filename, resolvedConfig);
114113
};
115114
}
115+
116+
/**
117+
* @param {any} config
118+
* @returns {config is import('vite').ResolvedConfig}
119+
*/
120+
function isResolvedConfig(config) {
121+
return !!config.inlineConfig;
122+
}

0 commit comments

Comments
 (0)