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

"esbuild-svelte" didn't set a resolve directory #69

Closed
Valexr opened this issue Sep 4, 2021 · 6 comments
Closed

"esbuild-svelte" didn't set a resolve directory #69

Valexr opened this issue Sep 4, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@Valexr
Copy link

Valexr commented Sep 4, 2021

When i use url() in css like:

content: url('img/img.jpg');
/* or */ 
background-image: url('img/img.jpg');

i have a error:

> fakecss:/path/to/Component.esbuild-svelte-fake-css:1:458: error: Could not resolve "img/img.jpg" (the plugin "esbuild-svelte" didn't set a resolve directory)

To Reproduce
REPO

Expected behavior
bundling url() to css 🤷🏻‍♂️

  • esbuild-svelte version: latest
  • esbuild version: latest
  • Svelte preprocessors used (if any): sass
@Valexr Valexr added the bug Something isn't working label Sep 4, 2021
@EMH333
Copy link
Owner

EMH333 commented Sep 7, 2021

Yep that's a bug! I'm a bit swamped this week but I'll get on this as soon as a can!

For future @EMH333 / anyone tackling this: Need to return resolveDir in the onResolve callback, however current code isn't set up to do that. Can split the file path and return that?

EMH333 added a commit that referenced this issue Sep 8, 2021
Helps #69
Also includes a minor TS update
@Valexr
Copy link
Author

Valexr commented Sep 18, 2021

Yep that's a bug! I'm a bit swamped this week but I'll get on this as soon as a can!

For future @EMH333 / anyone tackling this: Need to return resolveDir in the onResolve callback, however current code isn't set up to do that. Can split the file path and return that?

if in resolveDir true absolute path it's working

@EMH333
Copy link
Owner

EMH333 commented Sep 18, 2021

Fixed in v0.5.5

@EMH333 EMH333 closed this as completed Sep 18, 2021
@Valexr
Copy link
Author

Valexr commented Sep 19, 2021

What is this require(";`); in https://unpkg.com/browse/esbuild-svelte@0.5.5/dist/index.js line:23
I think error when build package

@EMH333
Copy link
Owner

EMH333 commented Sep 19, 2021

Oh wow! That appears to be a bug in rewrite-imports. I'll follow up later to confirm. Fix released in v0.5.6

@Valexr
Copy link
Author

Valexr commented Sep 19, 2021

tx for quick feedback 👍🏻 testing
Working now👍🏻
in resolveDir: /path/to/component/where/make/import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants