How to run gulp task after starting IIS Express session in visual studio 2015

I want to run the gulp task, which MUST start after my HTTP server is on the network on port 55555.

Thus, I manually start debugging IIS Express through F5 in Visual Studion, then I start my watch task.

I would like to have this in automatic mode.

I am using VS 2015 Pro with an asp.net core / vnext project.

gulp.task ('watch', function () {

bs.init({
  proxy: 'localhost:55555',
    notify: true,
    open: true,
    logLevel: 'debug',

});

bs.watch("./wwwroot/app/**/*.js", function (event, file) {
    gutil.log('Event: ' + event);
    if (event === "change") {
        bs.reload();
    }
});

});

Capturing the viewing task in the event after the assembly to start the task does not help, since iis express starts as the last when the assembly is completed and the viewing task starts: /

One solution can run my application locally on Full IIS, so port 55555 is always online, but iis express is convenient for development; -)

+4
1

Visual Studio gulnt gulp

, , ,

enter image description here

Gruntfile.js,

/// <binding AfterBuild='cleanup' />
module.exports = function(grunt) {
  require("jit-grunt")(grunt);
  grunt.initConfig({
    clean: ["./Modules/*"],
    copy: {
      main: {
        expand: true,
        src: [
          "../Modules/**/Views/**",
          "../Modules/**/bin/Debug/**/**/*.*",
          "../Modules/**/wwwroot/**",
          "!../Modules/AwesomeCMSCore.Modules.Frontend/**"
        ],
        dest: "./Modules/"
      },
      css: {
        expand: true,
        cwd: "../Modules/AwesomeCMSCore.Modules.Frontend/wwwroot/dist",
        src: ["cmscore.css"],
        dest: "./wwwroot/dist/"
      },
      js: {
        expand: true,
        cwd: "../Modules/AwesomeCMSCore.Modules.Frontend/wwwroot/dist",
        src: ["*.js"],
        dest: "./wwwroot/dist/"
      },
      static: {
        expand: true,
        cwd: "../Modules/AwesomeCMSCore.Modules.Frontend/wwwroot/dist",
        src: ["**"],
        dest: "./wwwroot/dist/"
      }
    },
    watch: {
      css: {
        files: ["../Modules/**/wwwroot/dist/*.css"],
        tasks: ["copy:css"],
        options: {
          reload: true,
          spawn: false
        }
      },
      js: {
        files: ["../Modules/**/wwwroot/dist/*.js"],
        tasks: ["copy:js"],
        options: {
          reload: true,
          spawn: false
        }
      }
    }
  });
  grunt.registerTask("default", ["watch"]);
  grunt.registerTask("cleanup", [
    "clean",
    "copy:main",
    "copy:static"
  ]);
};
0

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


All Articles