Search code examples
nugetnuspec

How do I specify a different target directory install for source files in Nuget?


Here's the structure of my web development project:

  • Web Project
    • Content
    • My Theme
      • Content
        • Less
        • Scripts
        • etc.

When I install Less Bootstrap Package, it always installs the files in the content directory:

  • Web Project
    • Content
      • bootstrap
    • My Theme
      • Content
        • Less
        • Scripts
        • etc.

I want it to install the files here:

  • Web Project
    • Content
      • bootstrap
    • My Theme
      • Content
        • Less
          • alerts.less
          • badges.less
          • etc.
        • Scripts
        • etc.

Is there a way to specify the target path for source files? I haven't seen any documentation on it and the only questions I've seen about this pertain to specifying where the .package files are installed. I have a difficult time believing that this option doesn't exist, especially considering that developers are very finicky about how they organize their source trees.


Solution

  • Currently this is not supported by NuGet. The location of the files is defined by the NuGet package and currently cannot be overridden.

    There is an open work item where this problem is discussed with proposed solutions but it has not yet been implemented.