【问题标题】:How to copy a sub directory to a root directory using grunt-contrib-copy?如何使用 grunt-contrib-copy 将子目录复制到根目录?
【发布时间】:2014-11-12 16:30:24
【问题描述】:

我的结构如下。我想将 assets 文件夹从 app 目录复制到 dist 目录?

app
   assets
      imgs
      css
      fonts
   index.html
dist

【问题讨论】:

    标签: gruntjs grunt-contrib-copy


    【解决方案1】:

    将当前工作目录设置为app。选择 assets 的所有子目录和文件。将目的地设置为dest

    grunt.initConfig({
        copy: {
            dist: {
                cwd: 'app',
                src: ['assets/**/*'],
                dest: 'dist/',
                expand: true
            }
        }
    });
    
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.registerTask('default', ['copy:dist']);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-07
      • 2013-10-25
      • 1970-01-01
      • 1970-01-01
      • 2011-11-03
      • 1970-01-01
      • 1970-01-01
      • 2017-10-25
      相关资源
      最近更新 更多