New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[context] build package files are not accessible #4626
Comments
I wasn't as involved at the creation of this package but I'd imagine omitting It's a valid point though whether Option types are useful for users wanting to pre-construct. We might do that for both I can't imagine why you'd want to manually create the @justinfagnani might have more context (😉) on what the intended exports were. |
I'm guessing it's non-intentional since it's a rather new feature/effect connected to In our project it took a while to discover that this addition is needed in the "exports" since it's a rather new limitation that is only respected by some build systems. But now we have everything in our package available and usable. The things we want to restrict for some reason are not included in the package at all and available in the source repo instead. Why I want to import these is because I'm extending the My current workaround (since the alias-workaround not fully worked unfortunatley) is actually just copying some of the raw files from the lib directory in the npm package instead. I would be totally fine if everything was exported in the index instead, but I guess it would be very easy to miss something. |
Which package(s) are affected?
Context (@lit/context)
Description
The build files in the
lib/
directory of the package can't be used when using modern import because they are not provided in theexports
section ofpackage.json
.In my case I try to use the following, which fails when building.
Adding
"./lib/*": "./lib/*
to"exports"
inpackage.json
would allow any file in thelib/
to be imported.Reproduction
lib
directory of@lit/context
in a .ts file in the project.vite build
.Workaround
Specify an alias for the file in vite.config.js.
Is this a regression?
No or unsure. This never worked, or I haven't tried before.
Affected versions
@lit/context@1.1.1
Browser/OS/Node environment
Lit 3.1.3
Typescript 5.4.5
Node v20.10
Vite v5.2.9
The text was updated successfully, but these errors were encountered: