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

[SSR][import.meta.glob] Resolve glob patterns starting with / to root #1875

Closed
brillout opened this issue Feb 4, 2021 · 0 comments
Closed

Comments

@brillout
Copy link
Contributor

brillout commented Feb 4, 2021

Is your feature request related to a problem? Please describe.

The glob patterns must be relative and start with ..

This makes sense in the context of building a custom SSR implementation: the code defining the glob pattern lives in the same file structure than the files being glob imported.

But this is not the case for SSR frameworks. The glob pattern is defined by the SSR framework, and the SSR framework code lives in antoher file structure than the user's app code.

Going from the SSR framework's file structure to the user's file structure using a relative path is brittle.

Describe the solution you'd like

Allow Glob patterns to start with /, which Vite then resolves relative to the root. For example import.meta.glob('/pages/*.vue') or import.meta.glob('/**/*.page.*').

brillout added a commit to brillout/vite that referenced this issue Mar 27, 2021
brillout added a commit to brillout/vite that referenced this issue Mar 27, 2021
brillout added a commit to brillout/vite that referenced this issue Mar 28, 2021
brillout added a commit to brillout/vite that referenced this issue Apr 11, 2021
brillout added a commit to brillout/vite that referenced this issue Apr 11, 2021
brillout added a commit to brillout/vite that referenced this issue Apr 11, 2021
brillout added a commit to brillout/vite that referenced this issue Apr 11, 2021
brillout added a commit to brillout/vite that referenced this issue Apr 23, 2021
brillout added a commit to brillout/vite that referenced this issue May 4, 2021
brillout added a commit to brillout/vite that referenced this issue May 19, 2021
brillout added a commit to brillout/vite that referenced this issue Jul 16, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant