{"id":14155919,"url":"https://github.com/unplugin/unplugin-unified","last_synced_at":"2025-06-21T03:09:58.533Z","repository":{"id":189930663,"uuid":"681647015","full_name":"unplugin/unplugin-unified","owner":"unplugin","description":"unified pipeline integration with unplugin","archived":false,"fork":false,"pushed_at":"2023-08-30T14:24:34.000Z","size":80,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T02:01:47.050Z","etag":null,"topics":["unified","unplugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/unplugin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["antfu"]}},"created_at":"2023-08-22T13:08:39.000Z","updated_at":"2024-07-03T01:36:05.000Z","dependencies_parsed_at":"2023-08-22T13:37:39.172Z","dependency_job_id":"baab81a3-a104-4a21-b1ae-79ee46a423a7","html_url":"https://github.com/unplugin/unplugin-unified","commit_stats":null,"previous_names":["antfu/unplugin-unified","unplugin/unplugin-unified"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unplugin/unplugin-unified","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-unified","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-unified/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-unified/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-unified/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unplugin","download_url":"https://codeload.github.com/unplugin/unplugin-unified/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-unified/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261055382,"owners_count":23103227,"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":["unified","unplugin"],"created_at":"2024-08-17T08:05:05.663Z","updated_at":"2025-06-21T03:09:53.514Z","avatar_url":"https://github.com/unplugin.png","language":"TypeScript","readme":"# unplugin-unified\n\n[![NPM version](https://img.shields.io/npm/v/unplugin-unified?color=a1b858\u0026label=)](https://www.npmjs.com/package/unplugin-unified)\n\n[unified](https://github.com/unifiedjs/unified) pipeline integration with [unplugin](https://github.com/unjs/unplugin), for Vite, Rollup, Webpack, Nuxt, esbuild, and more.\n\n## Install\n\n```bash\nnpm i unplugin-unified\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vite.config.ts\nimport Unified from 'unplugin-unified/vite'\n\nexport default defineConfig({\n  plugins: [\n    Unified({ /* options */ }),\n  ],\n})\n```\n\nExample: [`playground/`](./playground/)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRollup\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rollup.config.js\nimport Unified from 'unplugin-unified/rollup'\n\nexport default {\n  plugins: [\n    Unified({ /* options */ }),\n  ],\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('unplugin-unified/webpack')({ /* options */ })\n  ]\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNuxt\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// nuxt.config.js\nexport default {\n  buildModules: [\n    ['unplugin-unified/nuxt', { /* options */ }],\n  ],\n}\n```\n\n\u003e This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVue CLI\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('unplugin-unified/webpack')({ /* options */ }),\n    ],\n  },\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eesbuild\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// esbuild.config.js\nimport { build } from 'esbuild'\nimport Unified from 'unplugin-unified/esbuild'\n\nbuild({\n  plugins: [\n    Unified({ /* options */ })\n  ],\n})\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n## Configurations\n\nThis plugin allows you to configure multiple `unified` processors based on the file id. You can pass an array of rules to the plugin with different configurations.\n\n```ts\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport remarkGfm from 'remark-gfm'\nimport rehypeRaw from 'rehype-raw'\nimport rehypeStringify from 'rehype-stringify'\nimport rehypeShikiji from 'rehype-shikiji'\n\n// configure the plugin\nUnified({\n  rules: [\n    {\n      // match for `*.md` files\n      include: /\\.md$/,\n      // setup the unified processor\n      setup: unified =\u003e unified\n        .use(remarkParse)\n        .use(remarkGfm)\n        .use(remarkRehype, { allowDangerousHtml: true })\n        .use(rehypeRaw)\n        .use(rehypeShikiji, { themes: { dark: 'vitesse-dark', light: 'vitesse-light' } })\n        .use(rehypeStringify),\n      // custom transformers\n      transform: {\n        post(html) {\n          // wrap the generated HTML with `export default`\n          return `export default (${JSON.stringify(html)})`\n        },\n      },\n    },\n    {\n      include: /\\.vue$/,\n      exclude: /node_modules/,\n      enforce: 'pre', // run before vue plugins\n      // ...\n    },\n    // ... more rules\n  ],\n})\n```\n","funding_links":["https://github.com/sponsors/antfu"],"categories":["others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funplugin%2Funplugin-unified","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funplugin%2Funplugin-unified","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funplugin%2Funplugin-unified/lists"}