function pack(type, compress) {
    const output = type === 'docs' ? docsConfig.paths.output : config.paths.output;
    const concatenatedJS = compress ? filenames.concatenatedMinifiedJS : filenames.concatenatedJS;

    let src = globs.components
        .replace(/[{}]/g, '')
        .split(',')
        .map((c) => gulp.src(output.uncompressed + '/**/' + c + globs.ignored + '.js'));

    return ordered(src)
        .pipe(plumber())
        .pipe(dedupe())
        .pipe(replace(assets.uncompressed, assets.packaged))
        .pipe(concat(concatenatedJS))
        .pipe(gulpif(config.stripHeaders, replace(comments.header.in, comments.header.out)))
        .pipe(gulpif(compress, uglify(settings.concatUglify)))
        .pipe(header(banner, settings.header))
        .pipe(gulpif(config.hasPermissions, chmod(config.parsedPermissions)))
        .pipe(gulp.dest(output.packaged))
        .pipe(print(log.created));
}
Packages the JavaScript files in dist
@param {string} type - type of the js processing (none, rtl, docs)
@param {boolean} compress - should the output be compressed