小编Grz*_*jąc的帖子

Grunt-contrib-watch没有看到新文件

我像这样制作了Gruntfile.js:

'use strict';

module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-favicons');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-bake');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-cwebp');
grunt.loadNpmTasks('grunt-responsive-images');
grunt.loadNpmTasks('grunt-retinafy');
grunt.loadNpmTasks('grunt-spritesmith');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-contrib-watch');

require('load-grunt-tasks')(grunt);

grunt.initConfig({
    pkg : grunt.file.readJSON('package.json'),
    watch: {
        html: {
            files: ['./assets/**/*.html'],
            tasks: ['html'],
            options: {
                spawn: false,
                livereload: true,
            },
        },
        less: {
            files: ['./assets/less/**/*.less'],
            tasks: ['less_files'],
            options: {
                spawn: false,
                livereload: true,
            },
        },
        js: {
            files: ['./assets/js/**/*.js'],
            tasks: ['js'],
            options: {
                spawn: false,
                livereload: true,
            },
        },
        img: {
            files: ['./assets/images/**/*.png'],
            tasks: ['img'],
            options: {
                spawn: …
Run Code Online (Sandbox Code Playgroud)

macos node.js gruntjs grunt-contrib-watch

5
推荐指数
1
解决办法
1145
查看次数

标签 统计

grunt-contrib-watch ×1

gruntjs ×1

macos ×1

node.js ×1