Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

[Announcement] no more automatic call to yarn install #4

Closed
natemcmaster opened this issue Oct 14, 2017 · 0 comments
Closed

[Announcement] no more automatic call to yarn install #4

natemcmaster opened this issue Oct 14, 2017 · 0 comments

Comments

@natemcmaster
Copy link
Owner

In the 1.2.0 version of this package, I will be removing the default MSBuild target that calls yarn install when your project compiles. After discussion with others (#1) and a lot of dogfooding with this package on my own, I realized that there is no good default command.

Note: this will not affect those who have specified YarnBuildCommand in their projects.

Preserving existing behavior

To keep the existing behavior from 1.1 and earlier, add this to your project

<PropertyGroup>
  <YarnBuildCommand>install</YarnBuildCommand>
</PropertyGroup>

Justification

yarn install -
NuGet does not support on-install hooks, and does not have any plans to add it. Therefore, it is impossible to make this command run by default when dotnet restore works, or in Visual Studio. Although NuGet made improvements in 15.4 to add your own targets to MSBuild restore, it is not possible to do this reliably from within a package.

On build?
There is not default convention for how to run the "build" command on a javascript project. For some this is yarn run webpack, for others it's yarn run gulp. It's really up to your project, therefore, YarnBuildCommand is required.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant