You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Remove user-specified values for essential compilerOptions and log a warning (#346)
* fix: Remove user-set values for essential compilerOptions and log a warning
* chore: improve language
Co-authored-by: Conduitry <git@chor.date>
* chore: more language updates
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
* fix: ignore cssHash in dev only
* docs: update config
Co-authored-by: Conduitry <git@chor.date>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Copy file name to clipboardExpand all lines: docs/config.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,8 @@ A basic Svelte config looks like this:
42
42
// svelte.config.js
43
43
exportdefault {
44
44
// config options
45
+
compilerOptions: {},
46
+
preprocess: []
45
47
};
46
48
```
47
49
@@ -77,13 +79,11 @@ export default defineConfig({
77
79
78
80
These options are specific to the Svelte compiler and are generally shared across many bundler integrations.
79
81
80
-
<!-- TODO: Also note where these options can be placed in svelte.config.js -->
81
-
82
82
### compilerOptions
83
83
84
84
-**Type:**`CompileOptions` - See [svelte.compile](https://svelte.dev/docs#svelte_compile)
85
85
86
-
The options to be passed to the Svelte compiler. A few options are set by default, including `dev`, `format`and `css`. However, some options are non-configurable, like `filename`, `generate`, and `cssHash`.
86
+
The options to be passed to the Svelte compiler. A few options are set by default, including `dev`and `css`. However, some options are non-configurable, like `filename`, `format`, `generate`, and `cssHash` (in dev).
`The following Svelte compilerOptions are controlled by vite-plugin-svelte and essential to its functionality. User-specified values are ignored. Please remove them from your configuration: ${passedIgnored.join(
188
+
', '
189
+
)}`
190
+
);
191
+
passedIgnored.forEach((ignored)=>{
192
+
// @ts-expect-error string access
193
+
deleteoptions.compilerOptions[ignored];
194
+
});
195
+
}
196
+
}
197
+
180
198
// vite passes unresolved `root`option to config hook but we need the resolved value, so do it here
0 commit comments