Skip to content

fix(#3294): use loadFileSync when loading plugins with syncImport: true #3506

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

Merged
merged 2 commits into from
Jun 17, 2020

Conversation

Justineo
Copy link
Contributor

@Justineo Justineo commented May 29, 2020

Currently the only way to compile Less code synchronously is by setting syncImport: true. But as described in #3294, it cannot work when it involves plugins. In fact loadPlugin didn't have a sync version. This PR added a loadPluginSync method to fix this problem.


PS. I didn't quite understand how tests work so tests are not included. Any help would be appreciated.


Please note: compiled files are not included in this PR.

Justineo added 2 commits May 29, 2020 18:55

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…: true

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@Justineo
Copy link
Contributor Author

Justineo commented Jun 5, 2020

I've added some tests (including a regression test for import mentioned in #3294 (comment)).

@matthew-dean It would be very appreciated if you can take a look at this when you have time :)

@matthew-dean matthew-dean merged commit e018ba8 into less:master Jun 17, 2020
@matthew-dean
Copy link
Member

Thanks!

@Justineo Justineo deleted the sync-plugin branch June 30, 2020 08:27
@Justineo
Copy link
Contributor Author

Justineo commented Jul 2, 2020

Hi @matthew-dean, could you please release a new version when you have time? (I'm actually waiting for this feature to be shipped so that I can use Less plugins in a project based on vite, which only supports sync mode ATM). Thanks!

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.

None yet

2 participants