-
Notifications
You must be signed in to change notification settings - Fork 10
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
resolve (deeply) nested relative template paths to expected workspace path #435
Comments
I think as part of #466 , we can now support relative paths at least via the Koa server. However, for Rollup, we would need to resolve this because this being referenced from the docs/ directory?
Should be relatively easy to resolve I think though. |
|
Actually, in discovery, this looks like it is supported but only for top level pages / routes, anything nested will start to break because when at the top of the web root, as additional However, if your routes go deep enough, then those So given the above example <head>
<script type="module" src="../components/header.js"></script>
<script type="module" src="../components/footer.js"></script>
</head> An loading from the following routes will yield the following browser requests to the server
So, somehow just need handle any |
Type of Change
Summary
In a user's workspace, given a structure like this
Users could reference files in their templates one of two ways
/
../
Right now, only the first option is supported / documented *
* Technically the first option is supported but only if you are at 1 level of nesting as
../
can't break out of the web root, but once you go further, you start resolving the path relative to the browser's URL, leading to URLs like this will fail when resolved to the actual filesystemDetails
Ideally it would be great if Greenwood could support the
../
as deeply as needed, which would then allow editors and IDEs be able to do the directory resolution and autocomplete for users as well as not breaking path lookups to the workspace.What is nice about this, is that editors can resolve this for users and do autocomplete lookup, which is really nice. This also aligns with how paths are done in ESM, e.g.
Would also be good to resolve / address the following
./, ../
/
The text was updated successfully, but these errors were encountered: