Node.js 运行时未将HTML文件添加到已编译文件夹';咕噜声';-约曼脚手架

Node.js 运行时未将HTML文件添加到已编译文件夹';咕噜声';-约曼脚手架,node.js,gruntjs,yeoman,Node.js,Gruntjs,Yeoman,我用约曼搭建了我的地盘。我想使用玉模板,到目前为止,这是一半的工作,我的玉文件去tmp作为html文件文件夹和livereload显示这一罚款,但当我运行grunt建立我的网站的html文件从文件夹。tmp不会被放入我的公共_html文件夹。预期的所有其他文件夹/资产将公开 这是我的文件夹结构,对错误的说明表示歉意: 站点名称 ----.sass缓存 ----.tmp 应用程序 ----鲍尔_组件 ----图像 ----玉 ----脚本 ----样式 // Generated on 2013-

我用约曼搭建了我的地盘。我想使用玉模板,到目前为止,这是一半的工作,我的玉文件去tmp作为html文件文件夹和livereload显示这一罚款,但当我运行grunt建立我的网站的html文件从文件夹。tmp不会被放入我的公共_html文件夹。预期的所有其他文件夹/资产将公开

这是我的文件夹结构,对错误的说明表示歉意:

  • 站点名称
    ----.sass缓存
    ----.tmp

  • 应用程序
    ----鲍尔_组件
    ----图像
    ----玉
    ----脚本
    ----样式

  • // Generated on 2013-11-11 using generator-webapp 0.4.3
    'use strict';
    
    // # Globbing
    // for performance reasons we're only matching one level down:
    // 'test/spec/{,*/}*.js'
    // use this if you want to recursively match all subfolders:
    // 'test/spec/**/*.js'
    
    module.exports = function (grunt) {
        // show elapsed time at the end
        require('time-grunt')(grunt);
        // load all grunt tasks
        require('load-grunt-tasks')(grunt);
    
    grunt.initConfig({
        // configurable paths
        site_name: {
            app: 'app',
            public_html: 'public_html'
        },
        watch: {
            compass: {
                files: ['<%= site_name.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= site_name.app %>/styles/{,*/}*.css'],
                tasks: ['copy:styles', 'autoprefixer']
            },
            jade: {
                files: ['<%= site_name.app %>/jade/{,*/}*.jade'],
                tasks: ['jade']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '.tmp/{,*/}*.html',
                    '.tmp/styles/{,*/}*.css',
                    '{.tmp,<%= site_name.app %>}/scripts/{,*/}*.js',
                    '<%= site_name.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ]
            }
        },
        connect: {
            options: {
                port: 9000,
                livereload: 35729,
                // change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    open: true,
                    base: [
                        '.tmp',
                        '<%= site_name.app %>'
                    ]
                }
            },
            test: {
                options: {
                    base: [
                        '.tmp',
                        'test',
                        '<%= site_name.app %>'
                    ]
                }
            },
            public_html: {
                options: {
                    open: true,
                    base: '<%= site_name.public_html %>'
                }
            }
        },
        clean: {
            public_html: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= site_name.public_html %>/*',
                        '!<%= site_name.public_html %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= site_name.app %>/scripts/{,*/}*.js',
                '!<%= site_name.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
                }
            }
        },
        compass: {
            options: {
                sassDir: '<%= site_name.app %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= site_name.app %>/images',
                javascriptsDir: '<%= site_name.app %>/scripts',
                fontsDir: '<%= site_name.app %>/styles/fonts',
                importPath: '<%= site_name.app %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false,
                assetCacheBuster: false
            },
            public_html: {
                options: {
                    generatedImagesDir: '<%= site_name.public_html %>/images/generated'
                }
            },
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        autoprefixer: {
            options: {
                browsers: ['last 1 version']
            },
            public_html: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            public_html: {}
        },*/
        'bower-install': {
            app: {
                html: '<%= site_name.app %>/index.html',
                ignorePath: '<%= site_name.app %>/'
            }
        },
        // not enabled since usemin task does concat and uglify
        // check index.html to edit your build targets
        // enable this task if you prefer defining your build targets here
        /*uglify: {
            public_html: {}
        },*/
        rev: {
            public_html: {
                files: {
                    src: [
                        '<%= site_name.public_html %>/scripts/{,*/}*.js',
                        '<%= site_name.public_html %>/styles/{,*/}*.css',
                        '<%= site_name.public_html %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
                        '<%= site_name.public_html %>/styles/fonts/{,*/}*.*'
                    ]
                }
            }
        },
        jade: {
            public_html: {
                options: {
                    pretty: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= site_name.app %>/jade',
                    dest: '.tmp',
                    src: '{,*/}*.jade',
                    ext: '.html'
                }]
            }
        },
        useminPrepare: {
            options: {
                dest: '<%= site_name.public_html %>'
            },
            html: '<%= site_name.app %>/index.html'
        },
        usemin: {
            options: {
                dirs: ['<%= site_name.public_html %>']
            },
            html: ['<%= site_name.public_html %>/{,*/}*.html'],
            css: ['<%= site_name.public_html %>/styles/{,*/}*.css']
        },
        imagemin: {
            public_html: {
                files: [{
                    expand: true,
                    cwd: '<%= site_name.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= site_name.public_html %>/images'
                }]
            }
        },
        svgmin: {
            public_html: {
                files: [{
                    expand: true,
                    cwd: '<%= site_name.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= site_name.public_html %>/images'
                }]
            }
        },
        cssmin: {
            // This task is pre-configured if you do not wish to use Usemin
            // blocks for your CSS. By default, the Usemin block from your
            // `index.html` will take care of minification, e.g.
            //
            //     <!-- build:css({.tmp,app}) styles/main.css -->
            //
            // public_html: {
            //     files: {
            //         '<%= site_name.public_html %>/styles/main.css': [
            //             '.tmp/styles/{,*/}*.css',
            //             '<%= site_name.app %>/styles/{,*/}*.css'
            //         ]
            //     }
            // }
        },
        htmlmin: {
            public_html: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/murata/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '.tmp',
                    src: '*.html',
                    dest: '<%= site_name.public_html %>'
                }]
            }
        },
        // Put files not handled in other tasks here
        copy: {
            public_html: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= site_name.app %>',
                    dest: '<%= site_name.public_html %>',
                    src: [
                        '*.{ico,png,txt}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/{,*/}*.*',
                        'bower_components/sass-bootstrap/fonts/*.*'
                    ]
                }]
            },
            styles: {
                expand: true,
                dot: true,
                cwd: '<%= site_name.app %>/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            }
        },
        modernizr: {
            devFile: '<%= site_name.app %>/bower_components/modernizr/modernizr.js',
            outputFile: '<%= site_name.public_html %>/bower_components/modernizr/modernizr.js',
            files: [
                '<%= site_name.public_html %>/scripts/{,*/}*.js',
                '<%= site_name.public_html %>/styles/{,*/}*.css',
                '!<%= site_name.public_html %>/scripts/vendor/*'
            ],
            uglify: true
        },
        concurrent: {
            server: [
                'compass',
                'copy:styles'
            ],
            test: [
                'copy:styles'
            ],
            public_html: [
                'compass',
                'copy:styles',
                'imagemin',
                'svgmin',
                'htmlmin'
            ]
        }
    });
    
    grunt.registerTask('server', function (target) {
        if (target === 'public_html') {
            return grunt.task.run(['build', 'connect:public_html:keepalive']);
        }
    
        grunt.task.run([
            'clean:server',
            'jade',
            'concurrent:server',
            'autoprefixer',
            'connect:livereload',
            'watch'
        ]);
    });
    
    grunt.registerTask('test', [
        'clean:server',
        'concurrent:test',
        'autoprefixer',
        'connect:test',
        'mocha'
    ]);
    
    grunt.registerTask('build', [
        'clean:public_html',
        'useminPrepare',
        'concurrent:public_html',
        'jade',
        'autoprefixer',
        'concat',
        'cssmin',
        'uglify',
        'modernizr',
        'copy:public_html',
        'rev',
        'usemin'
    ]);
    
    grunt.registerTask('default', [
        /*'jshint',*/
        'test',
        'build'
    ]);
    
  • 公共\u html
    ----鲍尔_组件
    ----脚本
    ----样式

    // Generated on 2013-11-11 using generator-webapp 0.4.3
    'use strict';
    
    // # Globbing
    // for performance reasons we're only matching one level down:
    // 'test/spec/{,*/}*.js'
    // use this if you want to recursively match all subfolders:
    // 'test/spec/**/*.js'
    
    module.exports = function (grunt) {
        // show elapsed time at the end
        require('time-grunt')(grunt);
        // load all grunt tasks
        require('load-grunt-tasks')(grunt);
    
    grunt.initConfig({
        // configurable paths
        site_name: {
            app: 'app',
            public_html: 'public_html'
        },
        watch: {
            compass: {
                files: ['<%= site_name.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= site_name.app %>/styles/{,*/}*.css'],
                tasks: ['copy:styles', 'autoprefixer']
            },
            jade: {
                files: ['<%= site_name.app %>/jade/{,*/}*.jade'],
                tasks: ['jade']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '.tmp/{,*/}*.html',
                    '.tmp/styles/{,*/}*.css',
                    '{.tmp,<%= site_name.app %>}/scripts/{,*/}*.js',
                    '<%= site_name.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ]
            }
        },
        connect: {
            options: {
                port: 9000,
                livereload: 35729,
                // change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    open: true,
                    base: [
                        '.tmp',
                        '<%= site_name.app %>'
                    ]
                }
            },
            test: {
                options: {
                    base: [
                        '.tmp',
                        'test',
                        '<%= site_name.app %>'
                    ]
                }
            },
            public_html: {
                options: {
                    open: true,
                    base: '<%= site_name.public_html %>'
                }
            }
        },
        clean: {
            public_html: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= site_name.public_html %>/*',
                        '!<%= site_name.public_html %>/.git*'
                    ]
                }]
            },
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= site_name.app %>/scripts/{,*/}*.js',
                '!<%= site_name.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
                }
            }
        },
        compass: {
            options: {
                sassDir: '<%= site_name.app %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= site_name.app %>/images',
                javascriptsDir: '<%= site_name.app %>/scripts',
                fontsDir: '<%= site_name.app %>/styles/fonts',
                importPath: '<%= site_name.app %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false,
                assetCacheBuster: false
            },
            public_html: {
                options: {
                    generatedImagesDir: '<%= site_name.public_html %>/images/generated'
                }
            },
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        autoprefixer: {
            options: {
                browsers: ['last 1 version']
            },
            public_html: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            public_html: {}
        },*/
        'bower-install': {
            app: {
                html: '<%= site_name.app %>/index.html',
                ignorePath: '<%= site_name.app %>/'
            }
        },
        // not enabled since usemin task does concat and uglify
        // check index.html to edit your build targets
        // enable this task if you prefer defining your build targets here
        /*uglify: {
            public_html: {}
        },*/
        rev: {
            public_html: {
                files: {
                    src: [
                        '<%= site_name.public_html %>/scripts/{,*/}*.js',
                        '<%= site_name.public_html %>/styles/{,*/}*.css',
                        '<%= site_name.public_html %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
                        '<%= site_name.public_html %>/styles/fonts/{,*/}*.*'
                    ]
                }
            }
        },
        jade: {
            public_html: {
                options: {
                    pretty: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= site_name.app %>/jade',
                    dest: '.tmp',
                    src: '{,*/}*.jade',
                    ext: '.html'
                }]
            }
        },
        useminPrepare: {
            options: {
                dest: '<%= site_name.public_html %>'
            },
            html: '<%= site_name.app %>/index.html'
        },
        usemin: {
            options: {
                dirs: ['<%= site_name.public_html %>']
            },
            html: ['<%= site_name.public_html %>/{,*/}*.html'],
            css: ['<%= site_name.public_html %>/styles/{,*/}*.css']
        },
        imagemin: {
            public_html: {
                files: [{
                    expand: true,
                    cwd: '<%= site_name.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= site_name.public_html %>/images'
                }]
            }
        },
        svgmin: {
            public_html: {
                files: [{
                    expand: true,
                    cwd: '<%= site_name.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= site_name.public_html %>/images'
                }]
            }
        },
        cssmin: {
            // This task is pre-configured if you do not wish to use Usemin
            // blocks for your CSS. By default, the Usemin block from your
            // `index.html` will take care of minification, e.g.
            //
            //     <!-- build:css({.tmp,app}) styles/main.css -->
            //
            // public_html: {
            //     files: {
            //         '<%= site_name.public_html %>/styles/main.css': [
            //             '.tmp/styles/{,*/}*.css',
            //             '<%= site_name.app %>/styles/{,*/}*.css'
            //         ]
            //     }
            // }
        },
        htmlmin: {
            public_html: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/murata/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '.tmp',
                    src: '*.html',
                    dest: '<%= site_name.public_html %>'
                }]
            }
        },
        // Put files not handled in other tasks here
        copy: {
            public_html: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= site_name.app %>',
                    dest: '<%= site_name.public_html %>',
                    src: [
                        '*.{ico,png,txt}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/{,*/}*.*',
                        'bower_components/sass-bootstrap/fonts/*.*'
                    ]
                }]
            },
            styles: {
                expand: true,
                dot: true,
                cwd: '<%= site_name.app %>/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            }
        },
        modernizr: {
            devFile: '<%= site_name.app %>/bower_components/modernizr/modernizr.js',
            outputFile: '<%= site_name.public_html %>/bower_components/modernizr/modernizr.js',
            files: [
                '<%= site_name.public_html %>/scripts/{,*/}*.js',
                '<%= site_name.public_html %>/styles/{,*/}*.css',
                '!<%= site_name.public_html %>/scripts/vendor/*'
            ],
            uglify: true
        },
        concurrent: {
            server: [
                'compass',
                'copy:styles'
            ],
            test: [
                'copy:styles'
            ],
            public_html: [
                'compass',
                'copy:styles',
                'imagemin',
                'svgmin',
                'htmlmin'
            ]
        }
    });
    
    grunt.registerTask('server', function (target) {
        if (target === 'public_html') {
            return grunt.task.run(['build', 'connect:public_html:keepalive']);
        }
    
        grunt.task.run([
            'clean:server',
            'jade',
            'concurrent:server',
            'autoprefixer',
            'connect:livereload',
            'watch'
        ]);
    });
    
    grunt.registerTask('test', [
        'clean:server',
        'concurrent:test',
        'autoprefixer',
        'connect:test',
        'mocha'
    ]);
    
    grunt.registerTask('build', [
        'clean:public_html',
        'useminPrepare',
        'concurrent:public_html',
        'jade',
        'autoprefixer',
        'concat',
        'cssmin',
        'uglify',
        'modernizr',
        'copy:public_html',
        'rev',
        'usemin'
    ]);
    
    grunt.registerTask('default', [
        /*'jshint',*/
        'test',
        'build'
    ]);
    
    //于2013-11-11使用generator webapp 0.4.3生成
    "严格使用",;
    //#全球化
    //出于性能原因,我们只降低了一个级别:
    //'test/spec/{,*/}*.js'
    //如果要递归匹配所有子文件夹,请使用此选项:
    //“test/spec/***.js”
    module.exports=函数(grunt){
    //在末尾显示经过的时间
    要求(“时间咕噜”)(咕噜);
    //加载所有grunt任务
    要求('load-grunt-tasks')(grunt);
    grunt.initConfig({
    //可配置路径
    网站名称:{
    应用程序:“应用程序”,
    public_html:“public_html”
    },
    观察:{
    指南针:{
    文件:['/styles/{,*/}*{scss,sass}'],
    任务:['compass:server','autoprefixer']
    },
    风格:{
    文件:['/styles/{,*/}*.css'],
    任务:['copy:styles','autoprefixer']
    },
    杰德:{
    文件:['/jade/{,*/}*.jade'],
    任务:['jade']
    },
    利弗雷罗德:{
    选项:{
    livereload:'
    },
    档案:[
    “.tmp/{,*/}*.html”,
    “.tmp/styles/{,*/}*.css”,
    “{.tmp,}/scripts/{,*/}*.js”,
    “/images/{,*/}*{png,jpg,jpeg,gif,webp,svg}”
    ]
    }
    },
    连接:{
    选项:{
    港口:9000,
    利弗雷罗德:35729,
    //将此更改为“0.0.0.0”以从外部访问服务器
    主机名:“localhost”
    },
    利弗雷罗德:{
    选项:{
    开放:是的,
    基数:[
    “.tmp”,
    ''
    ]
    }
    },
    测试:{
    选项:{
    基数:[
    “.tmp”,
    "测试",,
    ''
    ]
    }
    },
    公共网页:{
    选项:{
    开放:是的,
    基:“”
    }
    }
    },
    清洁:{
    公共网页:{
    档案:[{
    多特:没错,
    src:[
    “.tmp”,
    '/*',
    “!/.git*”
    ]
    }]
    },
    服务器:'.tmp'
    },
    jshint:{
    选项:{
    jshintrc:“.jshintrc”
    },
    全部:[
    “Gruntfile.js”,
    “/scripts/{,*/}*.js”,
    “!/scripts/vendor/*”,
    'test/spec/{,*/}*.js'
    ]
    },
    摩卡咖啡:{
    全部:{
    选项:{
    run:是的,
    URL:['http://:/index.html']
    }
    }
    },
    指南针:{
    选项:{
    sassDir:“/styles”,
    cssDir:“.tmp/styles”,
    generatedImagesDir:'.tmp/images/generated',
    imagesDir:“/images”,
    javascriptsDir:“/scripts”,
    fontsDir:“/styles/fonts”,
    导入路径:'/bower_components',
    httpImagesPath:“/images”,
    httpGeneratedImagesPath:“/images/generated”,
    httpFontsPath:“/styles/fonts”,
    相对论:错,
    AssetCachBuster:错误
    },
    公共网页:{
    选项:{
    generatedImagesDir:“/images/generated”
    }
    },
    服务器:{
    选项:{
    debugInfo:true
    }
    }
    },
    自动刷新器:{
    选项:{
    浏览器:[“上一版本”]
    },
    公共网页:{
    档案:[{
    是的,
    cwd:“.tmp/styles/”,
    src:'{,*/}*.css',,
    目标:'.tmp/styles/'
    }]
    }
    },
    //未使用,因为丑陋的任务不起作用,
    //但如果需要,仍然可用
    /*康卡特:{
    public_html:{}
    },*/
    “bower安装”:{
    应用程序:{
    html:“/index.html”,
    忽略路径:'/'
    }
    },
    //未启用,因为usemin任务没有concat和uglify
    //选中index.html以编辑生成目标
    //如果希望在此处定义生成目标,请启用此任务
    /*丑陋的:{
    public_html:{}
    },*/
    修订版:{
    公共网页:{
    档案:{
    src:[
    “/scripts/{,*/}*.js”,
    “/styles/{,*/}*.css”,
    “/images/{,*/}*{png,jpg,jpeg,gif,webp}”,
    “/styles/fonts/{,*/}**”
    ]
    }
    }
    },
    杰德:{
    公共网页:{
    选项:{
    真的吗
    },
    档案:[{
    是的,
    cwd:“/jade”,
    目的地:'.tmp',
    src:“{,*/}*.jade”,
    分机:'.html'
    }]
    }
    },
    使用准备:{
    选项:{
    目标:“”
    },
    html:“/index.html”
    },
    usemin:{
    选项:{
    目录:['']
    },
    html:['/{,*/}*.html'],
    css:['/styles/{,*/}*.css']
    },
    imagemin:{
    公共网页:{
    档案:[{
    是的,
    cwd:“/images”,
    sr
    
    dest: '<%= site_name.public_html %>/'