{"id":19071905,"url":"https://github.com/cyansalt/parallelize-webpack-unplugin","last_synced_at":"2026-02-16T19:40:20.218Z","repository":{"id":65856877,"uuid":"601487336","full_name":"CyanSalt/parallelize-webpack-unplugin","owner":"CyanSalt","description":"Use unplugin with thread-loader in webpack","archived":false,"fork":false,"pushed_at":"2024-05-22T03:37:35.000Z","size":464,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-28T10:47:12.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyanSalt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-02-14T07:02:19.000Z","updated_at":"2024-07-23T11:57:47.000Z","dependencies_parsed_at":"2024-05-22T04:43:26.780Z","dependency_job_id":null,"html_url":"https://github.com/CyanSalt/parallelize-webpack-unplugin","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"6a1650743dd80c34dd2fa5041dedff336e8af5c0"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/CyanSalt/parallelize-webpack-unplugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fparallelize-webpack-unplugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fparallelize-webpack-unplugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fparallelize-webpack-unplugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fparallelize-webpack-unplugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyanSalt","download_url":"https://codeload.github.com/CyanSalt/parallelize-webpack-unplugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyanSalt%2Fparallelize-webpack-unplugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276655538,"owners_count":25680941,"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","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-09T01:32:20.550Z","updated_at":"2025-09-23T21:42:59.922Z","avatar_url":"https://github.com/CyanSalt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parallelize-webpack-unplugin\n\n[![npm](https://img.shields.io/npm/v/parallelize-webpack-unplugin.svg)](https://www.npmjs.com/package/parallelize-webpack-unplugin)\n\nUse [unplugin](https://github.com/unjs/unplugin/) with [thread-loader](https://github.com/webpack-contrib/thread-loader/) in [webpack](https://webpack.js.org/).\n\n## Why You Need It\n\nMany unplugin-based plugins will prompt you that they do not support use with `thread-loaders` (sometimes reflected in the `parallel` configuration of the Vue CLI). For example:\n\n- [`unplugin-vue2-script-setup`](https://github.com/antfu/unplugin-vue2-script-setup/issues/49#issuecomment-957304450)\n- [`unplugin-vue-macros`](https://github.com/sxzz/unplugin-vue-macros/issues/23#issuecomment-1170283222), also known as `@vue-macros/reactivity-transform`\n\n`thread-loader` [explains this](https://github.com/webpack-contrib/thread-loader/#getting-started). Since the loaders need to be executed within the worker process, it is not possible to access the compiler instance as with the loader which unplugin is injecting.\n\nThis module supports the conversion of unplugin-based plugins that satisfy the constraints into a form that supports `thread-loader`. Specifically:\n\n- The plugin is instantiated without side effects, i.e. the return value of the function passed to `createUnplugin` avoids the use of closure variables\n- The plugin does not rely on metadata in the context during instantiation, rather `meta.webpack.compiler`\n- `loadInclude` and `transformInclude` only determine the module `id`, ignoring `resourceQuery`\n- `loadInclude` and `transformInclude` cannot include external modules\n\nMost plugins satisfy the above conditions and can therefore be transformed.\n\n## Usage\n\n```shell\nnpm i -D parallelize-webpack-unplugin\n```\n\nThis module exports a `parallelize` method for converting unplugin-based plugins:\n\n```js\nconst { parallelize } = require('parallelize-webpack-unplugin')\n\n// To get a new unplugin plugin\nparallelize('/path/to/my-unplugin-plugin')\n```\n\nYou can just\n\n```diff\n// webpack.config.js\n- const { default: MyUnpluginPlugin } = require('/path/to/my-unplugin-plugin/webpack')\n\nmodule.exports = {\n  plugins: [\n-     MyUnpluginPlugin(options),\n+     parallelize('/path/to/my-unplugin-plugin')(options),\n  ],\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyansalt%2Fparallelize-webpack-unplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyansalt%2Fparallelize-webpack-unplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyansalt%2Fparallelize-webpack-unplugin/lists"}