Skip to content

Commit

Permalink
fix: prevent crash when css is null in Svelte 5
Browse files Browse the repository at this point in the history
fixes #216
  • Loading branch information
dummdidumm committed Mar 11, 2024
1 parent fe52a2d commit 9b5e8ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 7.2.0

- Support compiling `svelte.js/ts` files in Svelte 5
- Prevent crash when `css` is `null` in Svelte 5 ([#216](https://github.com/sveltejs/rollup-plugin-svelte/issues/216))

## 7.1.6

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ module.exports = function (options = {}) {
else this.warn(warning);
});

if (emitCss && compiled.css.code) {
if (emitCss && compiled.css && compiled.css.code) {
const fname = id.replace(new RegExp(`\\${extension}$`), '.css');
compiled.js.code += `\nimport ${JSON.stringify(fname)};\n`;
cache_emit.set(fname, compiled.css);
Expand Down

0 comments on commit 9b5e8ec

Please sign in to comment.