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

Support import module from HTTP #161

Open
1 task
zhmushan opened this issue Aug 23, 2023 · 1 comment
Open
1 task

Support import module from HTTP #161

zhmushan opened this issue Aug 23, 2023 · 1 comment

Comments

@zhmushan
Copy link

Describe the feature

Currently, UnoCSS uses JITI to read configuration files for better intelligence in VSCode. However, JITI cannot handle modules imported from HTTP, which results in UnoCSS not being able to provide intelligent suggestions when used with Deno.

related: unocss/unocss#3014

Example:

const jiti = require("jiti")(__filename);

jiti("./uno.config.ts"); // failed
// uno.config.ts
import presetUno from "https://esm.sh/@unocss/preset-uno@0.55.1";

export default {
  presets: [presetUno()],
};

Additional information

  • Would you be willing to help implement this feature?
@pi0
Copy link
Member

pi0 commented Aug 23, 2023

Thanks for the idea! I love it and actually was tracking from mlly (unjs/mlly#1, for mlly.loadURL) for same intention to use in jiti finally.

What is currently a blocker, is that jiti works on CommonJS system which cannot be async to support remote URLs like this. But we plan to introduce jiti.import(id): Promise<> to unblock this!

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