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
When publishing a package containing Svelte components, Svelte conventions dictate that the uncompiled Svelte component is made available using the svelte export condition in package.json, like so (example taken from svelte-french-toast's package.json:
For this to work with a Svelte transformer plugin, Parcel needs to know to use the svelte condition.
🤔 Expected Behavior
Either the Parcel user or a transformer plugin author should be able to globally add the svelte condition to Parcel's resolver.
😯 Current Behavior
Transformers can only add conditions for dependencies they are directly adding. Users can't add export conditions at all.
💁 Possible Solution
The transformers API could be extended to provide a way to add export conditions that are then used globally for all imports. This could be as simple as a property with an array of strings on the object passed to new Transformer.
Alternatively, the existing "@parcel/resolver-default" object for package.json could get a new property for specifying export conditions to add, and Svelte transformers could add to their documentation that you should put svelte there. This is similar to the solution used by rollup-plugin-svelte.
The text was updated successfully, but these errors were encountered:
🙋 feature request
When publishing a package containing Svelte components, Svelte conventions dictate that the uncompiled Svelte component is made available using the
svelte
export condition in package.json, like so (example taken from svelte-french-toast's package.json:For this to work with a Svelte transformer plugin, Parcel needs to know to use the
svelte
condition.🤔 Expected Behavior
Either the Parcel user or a transformer plugin author should be able to globally add the
svelte
condition to Parcel's resolver.😯 Current Behavior
Transformers can only add conditions for dependencies they are directly adding. Users can't add export conditions at all.
💁 Possible Solution
The transformers API could be extended to provide a way to add export conditions that are then used globally for all imports. This could be as simple as a property with an array of strings on the object passed to
new Transformer
.Alternatively, the existing
"@parcel/resolver-default"
object for package.json could get a new property for specifying export conditions to add, and Svelte transformers could add to their documentation that you should putsvelte
there. This is similar to the solution used by rollup-plugin-svelte.The text was updated successfully, but these errors were encountered: