Closed SayuShira closed 2 months ago
Removed the named volume due to a issue with updating node_modules. The volume would override the new dependencies from build. Removing the volume first would have worked, but looking that up every time dependencies are updated is annoying.
Instead of working around node_modules this now imports all needed directories and files individually and doesn't touch the rest.
Note: This then mean that if e.g. #10 is merged the docker configuration would likely have to include a volume ./i18n:/app/i18n
Since at the momentI can't build on windows (#11), I wanted to use Docker. As mentioned this ran slow on my system. I changed the Docker setup and saw major speed increases.
This PR seeks to implement them in the main repo if you are interested.
I can't pinpoint what made it run slow before. My best guess would be Docker Desktop for Windows and file IO between Windows and Docker on WSL2.
Comparison with my setup (Win + Docker WSL2):
There are differences in operation compared to before as well.
1) Build dependencies are baked into the image, thus the Image size change. This enables use of pnpm cache for rebuilds and (my guess) contributed to the faster execution times. To update dependencies just
docker compose build
with a newpnpm-lock.yaml
.2) Workaround for![image](https://github.com/goatcorp/dalamud-docs/assets/104025906/454f58b2-e6c8-4129-b058-25be8ba6fec6)
node_modules
If we create a volume of the whole dalamud-docs directorynode_modules
will be deleted in the container as it does not exist on the host. To avoid this/app/node_modules
is bound to named volume separate of the host filesystem. Bonus: You can have a node_modules directory on host without it spilling to the docker container and causing this:3) Despite some efforts to let docusaurus listen to FS events of the host, this still didn't work with the Windows/Docker setup. The default behavior now includes
--poll 1000
. Note: Some IDE, e.g. WebStorm, still don't trigger the FS events by default. For me changing this setting didn't hot reload either, that's why I'm defaulting to poll.This also includes 2 minor fixes that were mentioned in #11 as well.
Constructor
fails (apparently some OS are case sensitive and other aren't)<br>
brackets that start complaining in the docusaurus v3-betaFurthermore for if anyone who runs into this error again. At some point randomly, no changes to the dockerfiles, this error happend on startup:
Restarting the OS (in my case just WSL) did solve the issue again.