Fix #16659 - Unwanted node modules copying#17331
Merged
iOvergaard merged 1 commit intov15/devfrom Oct 29, 2024
Merged
Conversation
As noted in #16659, everything from `App_Plugins` is copied into the web output. This is unneeded and in the case of the `node_modules` directory unwanted behavior, these files are sources and not output that Umbracco needs to serve packages/extensions. The old behavior has led to many of the "path too long" errors we've been seeing while building extensions.
Member
Author
|
This should be cherry-picked to v14 when merged as well. Note: I ran into this because I was following the new Extending the backoffice training. I had problems building because of the infamous "path too long" error. I already have long path names enabled on my machine, so that does not always fix the problem. |
iOvergaard
approved these changes
Oct 29, 2024
nikolajlauridsen
pushed a commit
that referenced
this pull request
Nov 4, 2024
As noted in #16659, everything from `App_Plugins` is copied into the web output. This is unneeded and in the case of the `node_modules` directory unwanted behavior, these files are sources and not output that Umbracco needs to serve packages/extensions. The old behavior has led to many of the "path too long" errors we've been seeing while building extensions.
Contributor
|
Cherry-picked into the release 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
If there's an existing issue for this PR then this fixes #16659
Description
As noted in #16659, everything from
App_Pluginsis copied into the web output. This is unneeded and in the case of thenode_modulesdirectory unwanted behavior, these files are sources and not output that Umbracco needs to serve packages/extensions.dotnet buildstep needlessly long on the first run as it needs to copy over loads of small files.dotnet publishcommands, the wholenode_modulesfolder is included in the published output that people will try to put on a server, again leading to very slow copying times AND path too long errorsThe new behavior avoids all these problems.
Reproduction
csprojfile is App_Plugins.zipdotnet buildfor thiscsprojfile and note that inbin\Debug\net9.0\App_Plugins\vanilla-extensionanode_modulesfolder appearsbin\Debugfolderdotnet pack --configuration Release --output .\release\umbraco.slnis located, you will see areleasedirectory appearing which will contain the NuGet outputs for Umbracoreleasedirectory produced above, for example:E:\Dev\Umbraco-CMS15\releasecsprojfile is, run the following command:dotnet add package Umbraco.Cms --prerelease --source E:\Dev\Umbraco-CMS15\release(the--sourcepath is the one you copied in the last step).dotnet buildand note that thenode_modulesdirectory is NOT in thebin\Debug\net9.0\App_Plugins\vanilla-extensiondirectoryHere's a video of the steps I took to verify the before and after behavior:
fix16659.mp4