在 grunt:htmlrefs 构建期间无法写入"undefined"文件



设置看起来不错,但是对于SOREREAS,它看不到index.html文件?我做错了什么?cdnify在此之前运行,这没问题,实际上除了htmlrefs以外的所有工作都很好(除了cdnify不会与angular 1.2.12!)

Grunt Output

Running "htmlrefs:dist" (htmlrefs) task
Warning: Unable to write "undefined" file (Error code: undefined). Use --force to continue.

gruntfile

    htmlrefs: {
        dist: {
            src: '<%= yeoman.dist %>/index.html'
        }
    }
grunt.registerTask('build', [
    'clean:dist',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',  // For css files
    'concat',
    'preprocess:js',  // Remove DEBUG code from production builds
    'preprocess:html',  // Remove DEBUG code from production builds
    'ngmin',
    'copy:dist',
    'cdnify',
    'htmlrefs',
    'cssmin',
    'uglify',
    'rev',
    'usemin'
]);

解决方案是明确定义dest:

htmlrefs:{ DIST:{ src:'&lt;%= yeoman.dist%>/index.html', dest:'&lt;%= yeoman.dist%>/index.html' } }

我从中绘制了我的设置的示例,但是在明确指定后,我的构建已修复。

最新更新