Search code examples
asp.net-coreasp.net-core-mvcasp.net-core-cli

How to copy specific files to the publish directory in post-publish event


I'm doing a publish by using dot net core and I noticed all files contained in wwroot are copied the output folder, in my pre publish script I run tasks for concatenation, minification and uncss and as an output I get a single file, so I don't need to copy the whole wwwroot/css directory instead I just want to copy wwwroot/css/min which contains the file.

this is how the publish json structure looks like in the project.json:

"scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min:js", "gulp build" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }

any Ideas?


Solution

  • see publishExclude in https://github.com/aspnet/Home/wiki/Project.json-file for details on the project.json file