feat: support experimental.async and dynamicCompileOptions for Svelte modules #1176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #1174
Due to the way CompileOptions extends ModuleCompileOptions and how compileModule throws an error if you pass in an unknown option, simply forwarding the complete compileOptions would cause validation errors.
This PR prevents that by filtering with known module option names, which is going to require future updates for any new option that has to be passed.
An alternative could be to filter remove known non-module options. This makes it easier to introduce new module options, but new non-module options would then require updating the list to avoid them causing a validation error on compileModule.