使用IIS Express扩展

时间:2017-06-14 14:00:01

标签: javascript asp.net visual-studio-code iis-express grunt-browser-sync

我正在尝试实现的是使用Visual Studio代码编辑器安装IIS Express扩展时使用grunt运行browserSync。

我可以使用IIS同时运行proxy(Viusal Studio代码扩展)和browserSync:

Gruntfile.js

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    sass: {

      dist: {
        options: {
          outputStyle: 'expanded',
          sourceMap: true,
          sourceMapEmbed: true
        },
        files: {
          'scss/global.css': 'scss/mccann-global.scss',
          'scss/_imports/theme/dark-theme.css': 'scss/_imports/theme/dark-theme.scss',
          'scss/_imports/theme/light-theme.css': 'scss/_imports/theme/light-theme.scss',
        }
      }
    },

    watch: {
      grunt: {
        options: {
          reload: true
        },
        files: ['Gruntfile.js']
      },

      sass: {
        files: 'scss/**/*.scss',
        tasks: ['sass']
      }
    },
            browserSync: {
            dev: {
                bsFiles: {
                    src: [
                        'scss/*.css',
                        'index.aspx'
                    ]
                },
                options: 
                {
                    proxy: 'localhost:49798', //our IIS server
                    port: 3000, // our new port
                    open: true,
                    watchTask: true
                }
            }
        }
  });

  grunt.loadNpmTasks('grunt-browser-sync');
  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-grunticon');
  grunt.loadNpmTasks('grunt-exec');
  grunt.registerTask('build', ['sass']);
  grunt.registerTask('default', ['build','browserSync','watch']);
  
}

Grunt看起来不错:

enter image description here

然后:

安装了谷歌浏览器COORS插件,服务器通过登录页面运行得很好......但是一旦我点击主页,我就遇到了两个错误:401未经授权。

enter image description here enter image description here

我正在研究这个:Request format is unrecognized for URL unexpectedly ending in但是对我不起作用。

0 个答案:

没有答案