Skip to content

Commit ba09497

Browse files
committed
Exclude npm package.json from NuGet package
By updating the `package.json` and `package-lock.json` files to `Pack=false`, we ensure they aren't copied to the NuGet package unnecessarily. These are _exclusively_ needed for the build process itself. The SDK-style project will automatically add these as `<Content />` items _after_ the `Directory.Build.props` have run. As such, if we include them there, then they'll just get overwritten with the default configuration. If we update them in the `Directory.Build.targets`, however, they'll be correctly updated, since this is evaluated at the _end_ of the SDK-style project file.
1 parent 380b19a commit ba09497

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Directory.Build.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<Content Update="package.json" Pack="false" />
5+
<Content Update="package-lock.json" Pack="false" />
6+
</ItemGroup>
7+
8+
</Project>

OnTopic.Editor.AspNetCore.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
ProjectSection(SolutionItems) = preProject
1212
.gitignore = .gitignore
1313
Directory.Build.props = Directory.Build.props
14+
Directory.Build.targets = Directory.Build.targets
1415
GitVersion.yml = GitVersion.yml
1516
Icon.png = Icon.png
1617
README.md = README.md

0 commit comments

Comments
 (0)