Fix #16659 - Unwanted node modules copying #17331
Merged
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_Plugins
is copied into the web output. This is unneeded and in the case of thenode_modules
directory unwanted behavior, these files are sources and not output that Umbracco needs to serve packages/extensions.dotnet build
step needlessly long on the first run as it needs to copy over loads of small files.dotnet publish
commands, the wholenode_modules
folder 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
csproj
file is App_Plugins.zipdotnet build
for thiscsproj
file and note that inbin\Debug\net9.0\App_Plugins\vanilla-extension
anode_modules
folder appearsbin\Debug
folderdotnet pack --configuration Release --output .\release\
umbraco.sln
is located, you will see arelease
directory appearing which will contain the NuGet outputs for Umbracorelease
directory produced above, for example:E:\Dev\Umbraco-CMS15\release
csproj
file is, run the following command:dotnet add package Umbraco.Cms --prerelease --source E:\Dev\Umbraco-CMS15\release
(the--source
path is the one you copied in the last step).dotnet build
and note that thenode_modules
directory is NOT in thebin\Debug\net9.0\App_Plugins\vanilla-extension
directoryHere's a video of the steps I took to verify the before and after behavior:
fix16659.mp4