Grunt.js和browserSync @Storefront-任何提示均无效

时间:2018-07-24 15:46:10

标签: gruntjs browser-sync

下面的

是Gruntfile.js的片段,其中添加了browserSync,安装在localhost上。不幸的是,尽管没有立即发生的错误,但browserSync无法正常工作。有什么想法吗?

// Watch changes for assets.
    watch: {
        css: {
            files: [
                'style.scss',
                'assets/css/admin/welcome-screen/*.scss',
                'assets/css/woocommerce/*.scss',
                'assets/css/woocommerce/extensions/*.scss',
                'assets/css/jetpack/*.scss',
                'assets/css/base/*.scss',
                'assets/css/components/*.scss',
                'assets/css/sass/utils/*.scss',
                'assets/css/sass/vendors/*.scss'
            ],
            tasks: [
                'sass',
                'css'
            ]
        },
        js: {
            files: [
                //removed file names
            ],
            tasks: ['jshint', 'uglify']
        }
    },

    browserSync: {
  dev: {
    bsFiles: {
      src: [
        'style.css'


      ]
    },
options: {
      watchTask: true,
      proxy: 'http://localhost/ii/'
    }
  }
},

之后,我添加了

grunt.loadNpmTasks( 'grunt-browser-sync' );

作为注册任务:

// Register tasks
grunt.registerTask( 'default', [
    'css',
    'jshint',
    'uglify',
    'browserSync'

]);

0 个答案:

没有答案