fix: replace object shorthand to fix Rollup parse error #268
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.
When using jsdom in a Svelte 5 environment, the build fails due to a syntax error in cssstyle.
I added jsdom to a Svelte 5 project and only used the following minimal code:
However, running
vite buildresults in the following error:This error originates from the following object literal in
font.jsThe shorthand property syntax (
{ global }) is not correctly handled by Rollup in this build setup, which causes the parser to throw a syntax error during bundling.Replacing the shorthand property with an explicit key-value pair resolves the issue:
After applying this change,
vite buildcompletes successfully in the Svelte 5 environment.