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

fix(quasar): replace require() by readFileSync() in QuasarResolver #339

Merged
merged 4 commits into from
Mar 26, 2022

Conversation

stefanvanherwijnen
Copy link
Contributor

When using "type": "module", QuasarResolver leads to require() is not defined errors.
Because import() of JSON files is not supported yet, the solution is to use readFileSync for now (and resolve the path with local-pkg).

This might also solve #332

@antfu
Copy link
Member

antfu commented Mar 25, 2022

Why don't we use the async version?

@stefanvanherwijnen
Copy link
Contributor Author

No reason not to, but the current implementation is synchronous so I wasn't sure if changing it might break current implementations.

@antfu
Copy link
Member

antfu commented Mar 26, 2022

Let's use the async version then. The resolver should support async usage.

@antfu antfu changed the title fix: replace require() by readFileSync() in QuasarResolver fix(quasar): replace require() by readFileSync() in QuasarResolver Mar 26, 2022
@antfu antfu merged commit 5ab0251 into unplugin:main Mar 26, 2022
@philippedasilva-orizone

@stefanvanherwijnen I just wanted to let you know that these changes didn't make a difference on my current project (#332) but thanks anyway ;)
I'll try to see if I can find a way to reduce it later on.

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

Successfully merging this pull request may close these issues.

3 participants