Skip to content
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

Is it possible to disable asset imports? #229

Closed
SlexAxton opened this issue Feb 7, 2024 · 3 comments
Closed

Is it possible to disable asset imports? #229

SlexAxton opened this issue Feb 7, 2024 · 3 comments

Comments

@SlexAxton
Copy link

I am using vanilla extract, which imports .ts files called foo.css.ts

So in application code, it ends up looking like an asset import and triggers that pipeline.

import {vanillaExtractClass} from './file.css';

Then if I run packemon against a library that uses this:

ENOENT: no such file or directory, copyfile
 '/Users/alex/project/packages/@project/ui/src/Badge.css' ->
 '/Users/alex/project/packages/@project/ui/assets/Badge-70d967
 b6.css'

Presumably because there is no .css file. It's referring to a .css.ts file and the normal import behavior is what i'm after.

I don't actually need this feature, so it'd be fine if I could somehow disable it, or minimally disable it for .css files. My guess is there's some way to inject a rollup config override, but I haven't found the exact right magic.

@milesj
Copy link
Owner

milesj commented Feb 7, 2024

There's no way to disable it, but we can patch it to check if the file actually exists.

@milesj
Copy link
Owner

milesj commented Feb 8, 2024

@SlexAxton Can you try 3.3.0?

@SlexAxton
Copy link
Author

Hey, sorry for the delay, don't get to work on this one every day, but this worked great. You're a hero. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants