You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue loading the is-land plugin in an 11ty webc project. I have a large, complicated webapp codebase, where eleventy is but a small part of a larger system. The eleventy bits are located in a subdirectory of this project, ./public, while the package.json for this project exists one directory up, in the root of the project. Thus, node_modules exists one parent directory above where the eleventy project exists.
My particular problem boils down to two issues, I think, which are related:
Issue (1) effectively prevents setting webc component loading to any directory that is not an immediate subdirectory within the eleventy project. For a monorepo style setup, this seems like an unnecessarily restrictive constraint. As mentioned, since in my setup, node_modules is one level up above the eleventy project, that exception is troublesome. Could we consider dropping the code I linked to in (1)?
Issue (2) is related to the same problem: the npm: component loading alias assumes something about the location of the node_modules directory. There is a TODO here, tantalizingly hinting at perhaps the author foreseeing an issue similar to what I'm describing here. I was thinking one way to improve this would be to search up the file tree to find the npm project root first (by looking for the presence of a package.json file), and then joining that found project root with ./node_modules. I think that would solve this issue? What do you think?
I am happy to give a PR a go to try to fix this! I wanted first to check if my thinking is correct / is a PR worth it / would the project be responsive to the issue / provide guidance on how to go about improving the situation.
Thanks for any discussion and thank you once more for an amazing open source project!
The text was updated successfully, but these errors were encountered:
Apologies, I have since moved to a different solution and have stopped using webc as a result. Unfortunately, I did not save the project state from that time 😢
First of all: you rock! Love the projects, excellent work, very grateful ❤️
I described my issue in a comment in some more detail over in the
eleventy-plugin-webc
repo.I have an issue loading the
is-land
plugin in an 11ty webc project. I have a large, complicated webapp codebase, where eleventy is but a small part of a larger system. The eleventy bits are located in a subdirectory of this project,./public
, while thepackage.json
for this project exists one directory up, in the root of the project. Thus,node_modules
exists one parent directory above where the eleventy project exists.My particular problem boils down to two issues, I think, which are related:
fsCache
module seems (to me) unnecessarily restrictive re: requiring components to be subdirectories of the "working directory"npm:
component loading aliasing assumesnpm:
maps to./node_modules
Issue (1) effectively prevents setting webc component loading to any directory that is not an immediate subdirectory within the eleventy project. For a monorepo style setup, this seems like an unnecessarily restrictive constraint. As mentioned, since in my setup,
node_modules
is one level up above the eleventy project, that exception is troublesome. Could we consider dropping the code I linked to in (1)?Issue (2) is related to the same problem: the
npm:
component loading alias assumes something about the location of thenode_modules
directory. There is aTODO
here, tantalizingly hinting at perhaps the author foreseeing an issue similar to what I'm describing here. I was thinking one way to improve this would be to search up the file tree to find the npm project root first (by looking for the presence of apackage.json
file), and then joining that found project root with./node_modules
. I think that would solve this issue? What do you think?I am happy to give a PR a go to try to fix this! I wanted first to check if my thinking is correct / is a PR worth it / would the project be responsive to the issue / provide guidance on how to go about improving the situation.
Thanks for any discussion and thank you once more for an amazing open source project!
The text was updated successfully, but these errors were encountered: