Skip to content

ESM: Support for Subpath patterns  #6147

@barelyhuman

Description

@barelyhuman

🌈 Feature

Ability to handle subpath patterns

What is this feature?

A few libraries with a lot of exports would prefer to use the above pattern while creating exports and this current breaks in CSB example sandbox https://codesandbox.io/s/kind-payne-i2eb3?file=/src/App.tsx for https://github.com/pmndrs/jotai

The feature or maybe even a bug would be to add resolution handlers for the exports field to have glob patterns and absolute file paths.

How the feature should work?

The feature or maybe even a bug would be to add resolution handlers for the exports field to have glob patterns and absolute file paths.

You have examples or an idea how it can be implemented?

You can follow the node docs https://nodejs.org/api/packages.html#packages_subpath_patterns , as this was added to both v12 and v14 and already supported by v16

I wouldn't mind raising a PR but I was unable to find the point of generation for packages. I'm assuming it's the sandpack package code but I'm not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ FeatureIndicates that this adds a new feature.🎒 BundlerRefers to CodeSandbox's In-Browser Bundler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions