LoginSignup
9
8

More than 5 years have passed since last update.

grunt-contrib-copyでフォルダを除外する

Posted at

以下のフォルダ構成で「hogehoge」フォルダをコピーしない用のGruntfile.jsが

src/
├── controller
│   └── Common.ts
├── hogehoge
│   ├── en.po
│   └── ja.po
├── model
│   └── User.ts
└── view
    ├── Top.html
    └── Sample.html

これです↓

Gruntfile.js
"use strict";

module.exports = function (grunt) {
  grunt.initConfig({
        copy: {
          main: {
            expand: true,
            src: ['**/*',  '!**/hogehoge/**'],
            cwd: 'src',
            dest: 'release/src',
          }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-copy');


  grunt.registerTask('default', ['copy']);
};
9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8