grunt-unbuild

Support remove generated files

npm install grunt-unbuild
3 downloads in the last month

Grunt Save / Remove Generated Files

Build Status Dependency Status

Install

$ npm install grunt-unbuild --save-dev

Getting Started

saveBuild : Save Generated Files List

module.exports = function (grunt) {

    grunt.initConfig({

        saveBuild : {
            default : {
                archive : 'generated.json',
                patterns : [
                    '{temp/**/*.as,temp/**/*.mxml}',
                    'temp/**/*.as',
                    'temp/mailer/models/Email.as'
                ]
            }
        }

    });
}

saveBuild task have two parameters.

  • string archive list file save path
  • array patterns generated files (glob) patterns

unbuild : Rmove Generated Files

module.exports = function (grunt) {

    grunt.initConfig({

        unbuild : {
            default : {
                archive : 'generated.json'
            }
        }

    });

}

unbuild task have just one parameter.

  • string archive list file

Full Usage Code

module.exports = function (grunt) {

    grunt.initConfig({

        saveBuild : {
            default : {
                archive : 'generated.json',
                patterns : [
                    '{temp/**/*.as,temp/**/*.mxml}',
                    'temp/**/*.as',
                    'temp/mailer/models/Email.as'
                ]
            }
        },

        unbuild : {
            default : {
                archive : 'generated.json'
            }
        }

    });

    grunt.loadNpmTasks('grunt-unbuild');

    grunt.registerTask('default', ['unbuild', 'some-build-tasks...', 'saveBuild']);
}

Task steps

  1. unbuild : If exists generated.json file. Remove all files on generated.json list
  2. some-build-tasks : Build and generate your codes
  3. saveBuild : Save generated file list to generated.json file
npm loves you