javascript - grunt-copy怎么复制某个文件夹所有文件
ringa_lee
ringa_lee 2017-04-10 15:48:45
[JavaScript讨论组]
copy: {
    html: {
        src: 'index/*', // index/*.html 或者 index/**都不行
        dest: 'dist/'
    }
},

有两个问题:
① 我index里有多个文件,我想复制到dist下,结果只能复制第一个过去(命令行里显示的是 复制成功了多个)
② 我想复制过去不把index这个文件夹也带过去,只把各个文件复制到dist目录下,而不是复制到dist/index/目录下
请问怎么解决

ringa_lee
ringa_lee

ringa_lee

全部回复(1)
巴扎黑
copy: {
    html: {
        files: [
            {
                expand: true,
                cwd: 'index',
                src: ['index/**'],
                dest: 'dest'
            }               
        ]
    }
}

————————————————————————————————————————————
修复

copy: {
    html: {
        files: [
            {
                expand: true,
                cwd: 'index',
                src: ['**'],
                dest: 'dest'
            }               
        ]
    }
}
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号