Skip to content

Conversation

@felix-roehrich
Copy link

@sveltejs/package does not resolve aliases for side effect imports. This is annoying when you have global CSS in your library and want to import that in Svelte components. With this PR side effect imports are now also resolved.

I have added tests for this, but the behaviour for the .d.ts file is weird. When using the currently published version, the CSS import is stripped from .d.ts file, but for the tests it is still there.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link

changeset-bot bot commented Mar 30, 2024

🦋 Changeset detected

Latest commit: b8a6c76

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/package Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benmccann benmccann changed the title fix: @sveltejs/package now resolves side effect imports fix: resolve side effect imports Apr 1, 2024
@benmccann benmccann added the pkg:svelte-package Issues related to svelte-package label Apr 1, 2024
@felix-roehrich felix-roehrich closed this by deleting the head repository Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:svelte-package Issues related to svelte-package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants