Gruntjs Grunt-不使用usemin复制特定文件

Gruntjs Grunt-不使用usemin复制特定文件,gruntjs,yeoman,Gruntjs,Yeoman,我想将特定的coffeescript文件(不包括在我的index.html中的部分)复制到例如dist/scripts目录中 我尝试了(grunfile.js): 复制:{ 地区:{ 档案:[ // ... { 是的, cwd:“./tmp/scripts/polyfill”, dest:“/scripts/polyfill”, src:[ '*' ] }] } }, 如果您只想复制一个文件,可以使用更简单的grunt语法: copy: { dist: { files:

我想将特定的coffeescript文件(不包括在我的
index.html
中的
部分)复制到例如
dist/scripts
目录中

我尝试了(
grunfile.js
):

复制:{
地区:{
档案:[
// ...
{
是的,
cwd:“./tmp/scripts/polyfill”,
dest:“/scripts/polyfill”,
src:[
'*'
]
}]
}
},

如果您只想复制一个文件,可以使用更简单的grunt语法:

copy: {
    dist: {
        files: [{
            '.tmp/scripts/polyfill/myfile.js': '<%= yeoman.dist %>/scripts/polyfill/myfile.js'
        }]
    }
}
复制:{
地区:{
档案:[{
“.tmp/scripts/polyfill/myfile.js”:“/scripts/polyfill/myfile.js”
}]
}
}
另外,临时文件夹的名称是
.tmp
,而不仅仅是
tmp

,这样做有效:

{
    expand: true,
    cwd: '.tmp/scripts/polyfill',
    dest: '<%= yeoman.dist %>/scripts/polyfill',
    src: [
        'polyfill.js'
    ]
}
{
是的,
cwd:“.tmp/scripts/polyfill”,
dest:“/scripts/polyfill”,
src:[
'polyfill.js'
]
}

我的方法很好,但是它包含一个输入错误:
/tmp
-应该是
。tmp

不起作用,但是您在我的代码中突出显示了一个输入错误:
/tmp
:)但是,这会复制所有
.js
文件,而不是特定的文件。我可以只传递
polyfill.js
而不是
*.js
{
    expand: true,
    cwd: '.tmp/scripts/polyfill',
    dest: '<%= yeoman.dist %>/scripts/polyfill',
    src: [
        'polyfill.js'
    ]
}