{"id":13659343,"url":"https://github.com/zoubin/post-factor-bundle","last_synced_at":"2025-02-26T08:41:38.693Z","repository":{"id":57327708,"uuid":"41480438","full_name":"zoubin/post-factor-bundle","owner":"zoubin","description":"Add features to make factor-bundle more friendly","archived":false,"fork":false,"pushed_at":"2015-08-28T10:20:23.000Z","size":148,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T22:43:21.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-27T10:27:20.000Z","updated_at":"2016-04-18T08:44:43.000Z","dependencies_parsed_at":"2022-09-16T07:23:28.023Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/post-factor-bundle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fpost-factor-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fpost-factor-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fpost-factor-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fpost-factor-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/post-factor-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240822615,"owners_count":19863302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T05:01:07.730Z","updated_at":"2025-02-26T08:41:38.663Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","readme":"# post-factor-bundle\nAdd features to make factor-bundle more friendly.\n\n## Example\n\n```javascript\nvar gulp = require('gulp');\nvar path = require('path');\nvar buffer = require('vinyl-buffer');\nvar uglify = require('gulp-uglify');\nvar browserify = require('browserify');\nvar merge = require('merge-stream');\nvar source = require('vinyl-source-stream');\n\nvar factor = require('../lib/factor');\n\nvar fixtures = path.resolve.bind(\n  path, __dirname, 'src', 'page'\n);\n\nvar entries = [\n  fixtures('blue/index.js'),\n  fixtures('red/index.js'),\n];\n\ngulp.task('default', function (cb) {\n  var b = browserify({\n    entries: entries,\n  });\n  b.plugin(factor, {\n    entries: entries,\n    outputs: function () {\n      return [source('blue.js'), source('red.js')];\n    },\n  });\n  b.on('factor.pipelines', function (f, p, outs) {\n    stream.add(outs);\n  });\n  var stream = merge(\n    b.bundle().pipe(source('common.js'))\n  );\n  return stream\n    .pipe(buffer())\n    .pipe(uglify())\n    .pipe(gulp.dest('./build'));\n});\n\n```\n\n## b.plugin(factor, opts)\n\n### opts\n\n#### entries\n\nType: `Array`\n\nThe array of entry files to create a page-specific bundle for each file.\n\n#### outputs\n\nType: `Array`, `Function`\n\nAn array that pairs up with the files array to specify where each bundle output for each entry file should be written.\nIf `Function`, it should return such an array.\n\n#### threshold\n\nType: `Number`, `Function`\n\nDefault: `1`\n\nSee [factor-bundle](https://github.com/substack/factor-bundle#var-fr--factorfiles-opts)\n\n#### pack\n\nType: `Function`\n\nTransform to replace `browser-pack`.\n\n## b.on('factor.pipelines', function (files, pipelines, outputStreams) {})\n\n`files` and `pipelines` are both `Array`,\nand elements are explained in [factor-bundle](https://github.com/substack/factor-bundle#bonfactorpipeline-function-file-pipeline-)\n\n`outputStreams` is `Array`, containing all output streams except the common stream.\n\n## [Changelog](changelog.md)\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fpost-factor-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fpost-factor-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fpost-factor-bundle/lists"}