Asp.net Core 1.0 project.json for scripting

Hey, this is part of my project.json file:

  "scripts": {
        "prepublish": [
          "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js",
          "node node_modules/webpack/bin/webpack.js"
        ],
        "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
      },

I want to call prepublish scripts every time I publish an application, even if it is a development environment, and I run it through a visual studio or dotnet launch. Prepublishdoesn't seem to work in these cases

+4
source share
1 answer

When you start VS or use "dotnet run", you only create and run the application from the source without publishing. Publishing scripts will run if you call dotnet publish.

dotnet run . , .

script:

  • postcompile
  • prepublish
  • postpublish

, , "beforerun" / "postrun". .

+1

Source: https://habr.com/ru/post/1648022/


All Articles