1.0.0 • Published 7 months ago

@ilabdev/archive v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@ilabdev/archive

Gulp tasks for archiving files & directories for deployment

Installation & set up

Install @ilabdev/archive

npm install @ilabdev/archive --save-dev

-- OR --

yarn add @ilabdev/archive --dev

Include @ilabdev/archive in your gulpfile.js

NOTE: Make sure you pass gulp through to the package as shown below. The package sets up gulp tasks and will need it passed through to work.

require( '@ilabdev/archive' )( gulp )

Add the content from config.sample.js to your .gulpconfig.js and adjust as appropriate

module.exports = {
    // Other configs here...
    archive: {
        process: true,
        logColor: 'blue',
        areas: [
            {
                paths: {
                    src: [
                        '**/*',
                        '!**/*.zip*',
                        '!**/*.tar',
                    ],
                    dest: './dist',
                },
                pipes: {
                    src: {
                        allowEmpty: true,
                        base: './',
                    },
                    dest: {},
                    archiver: {
                        filename: `PACKAGE-1.0.0.zip`,
                        format: 'zip',
                        options: {
                            gzip: false,
                        },
                    },
                },
            },
        ],
    },
    // Other configs here...
}

Run gulp archive to run the task, or add the task as a script and run that with npm or yarn

Config

process

Type: boolean

Whether to archive files & directories or not

loggerColor

Type: string

The logger color to use for any output text. See https://github.com/stgdp/fancy-logger#available-modifiers for colors that can be used

areas

Type: object[]

The areas to be archived. Each area has it's own, isolated settings to allow for separate configs

areas[].paths

Type: object

Path references for the archiver

areas[].paths.src

Type: string[]|string

The paths to archive. Passed through to gulp.src, items can be globs

areas[].paths.dest

Type: string

The destination path of the archive. Passed through to gulp.dest, items can be globs

areas[].pipes

Type: object

Options to be passed through to the pipes

areas[].pipes.src

Type: object

Options to be passed through to the gulp.src pipe. See https://gulpjs.com/docs/en/api/src/ for more information

areas[].pipes.dest

Type: object

Options to be passed through to the gulp.dest pipe. See https://gulpjs.com/docs/en/api/dest/ for more information

areas[].pipes.archiver

Type: object

Options to be passed through to the @stgdp/gulp-archiver pipe. See https://www.npmjs.com/package/@stgdp/gulp-archiver for more information