{"id":17497217,"url":"https://github.com/miguelcastillo/bit-plugin-builder","last_synced_at":"2025-04-03T00:27:22.357Z","repository":{"id":143858188,"uuid":"49290927","full_name":"MiguelCastillo/bit-plugin-builder","owner":"MiguelCastillo","description":"Helper for creating bit-loader plugin configurations","archived":false,"fork":false,"pushed_at":"2020-05-23T12:07:00.000Z","size":43,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T07:19:08.852Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MiguelCastillo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-08T19:08:23.000Z","updated_at":"2025-02-16T05:36:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"2075123b-7f1b-4be6-b5cc-00a29ccca818","html_url":"https://github.com/MiguelCastillo/bit-plugin-builder","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelCastillo%2Fbit-plugin-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelCastillo%2Fbit-plugin-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelCastillo%2Fbit-plugin-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelCastillo%2Fbit-plugin-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiguelCastillo","download_url":"https://codeload.github.com/MiguelCastillo/bit-plugin-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246915133,"owners_count":20854337,"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-10-19T15:19:15.158Z","updated_at":"2025-04-03T00:27:22.339Z","avatar_url":"https://github.com/MiguelCastillo.png","language":"JavaScript","readme":"# DEPRECATED - This has been moved into bit-bundler as well as bit-imports and made available when registering a plugin as a function.\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/MiguelCastillo/bit-plugin-builder.svg)](https://greenkeeper.io/)\n\n``` javascript\nvar bundler = new Bitbundler({\n  loader: {\n    plugins: [\n      function(builder) {\n        return builder.configure({\n          extensions: [\"esm\"]\n        });\n      }\n    ]\n  }\n});\n```\n\n# bit-plugin-builder\n\u003e Helper for creating bit-loader plugin configurations\n\nPlugin builder simplifies the process of creating configurations for bit-loader plugins. It merges transforms, resolve, fetch, dependency handlers in a Plugin. It also merges match and ignore rules.\n\n#### PluginBuilder.create(options) : PluginBuilder\n  Factory method to create a Plugin builder. Options can be passed in for setting the intial state of the Plugin builder.\n\n  - returns PluginBuilder instance\n\n``` javascript\n  var utils = require(\"bit-bundler-utils\");\n\n  var defaultOptions = {\n    match: {\n      path: /[\\w]+\\.(js)$/\n    }\n  };\n\n  var pluginBuilder = PluginBuilder.create(defaultOptions);\n```\n\n#### configure(options) : PluginBuilder\n\n  Method to configure PluginBuilder instance\n\n  - returns PluginBuilder instance (self)\n\n\n``` javascript\n  pluginBuilder = pluginBuilder.configure({\n    transform: function(meta) {\n      console.log(meta);\n    }\n  });\n```\n\n#### build() : Object\n\n  Method that creates a plugin configuration object to register plugins with the loader\n\n  - returns loader plugin configuration\n\n``` javascript\n  var plugin = pluginBuilder.build();\n```\n\n#### Examples\n\nSample plugin that loads JSON files.\n\n``` javascript\nvar PluginBuilder = require(\"bit-bundler-utils/PluginBuilder\");\n\nvar defaults = {\n  match: {\n    path: /[\\w]+\\.(json)$/\n  },\n  dependency: function dependencyText(meta) {\n    return {\n      source: \"module.exports = \" + meta.source + \";\"\n    };\n  }\n};\n\nfunction textPlugin(options) {\n  return PluginBuilder\n    .create(defaults)\n    .configure(options)\n    .build();\n}\n\nmodule.exports = textPlugin;\n```\n\nLicense\n===============\n\nLicensed under MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelcastillo%2Fbit-plugin-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelcastillo%2Fbit-plugin-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelcastillo%2Fbit-plugin-builder/lists"}