Skip to content

Commit d3d4052

Browse files
authored
fix: don't log inline config when encountering unexpected options (#1376)
1 parent c9feef6 commit d3d4052

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎.changeset/common-bushes-kick.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/vite-plugin-svelte': patch
3+
---
4+
5+
fix: don't log inline config when encountering unexpected options

‎packages/vite-plugin-svelte/src/utils/options.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ export function validateInlineOptions(inlineOptions) {
6060
const invalidKeys = Object.keys(inlineOptions || {}).filter(
6161
(key) => !allowedInlineOptions.has(key)
6262
);
63-
if (invalidKeys.length) {
64-
log.warn(`invalid plugin options "${invalidKeys.join(', ')}" in inline config`, inlineOptions);
63+
64+
const n = invalidKeys.length;
65+
if (n > 0) {
66+
log.warn(
67+
`invalid plugin ${n === 1 ? 'option' : 'options'} ${invalidKeys.map((k) => `\`${k}\``).join(', ')} in inline config`
68+
);
6569
}
6670
}
6771

0 commit comments

Comments
 (0)