{"id":15691132,"url":"https://github.com/thgh/payload-plugin-resolve-alias","last_synced_at":"2025-08-23T09:11:08.291Z","repository":{"id":62739920,"uuid":"562124033","full_name":"thgh/payload-plugin-resolve-alias","owner":"thgh","description":"Shorthand to add common webpack aliases","archived":false,"fork":false,"pushed_at":"2023-12-10T13:28:24.000Z","size":288,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T10:50:14.509Z","etag":null,"topics":["payload","payload-plugin","payloadcms"],"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/thgh.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":"2022-11-05T11:41:07.000Z","updated_at":"2023-12-05T20:29:24.000Z","dependencies_parsed_at":"2024-10-24T00:14:45.777Z","dependency_job_id":"856fdb84-eba9-4ffa-a7f2-a258881f361a","html_url":"https://github.com/thgh/payload-plugin-resolve-alias","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"59c3df85dd4ceaf994664245f715965131e4919f"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thgh/payload-plugin-resolve-alias","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thgh%2Fpayload-plugin-resolve-alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thgh%2Fpayload-plugin-resolve-alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thgh%2Fpayload-plugin-resolve-alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thgh%2Fpayload-plugin-resolve-alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thgh","download_url":"https://codeload.github.com/thgh/payload-plugin-resolve-alias/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thgh%2Fpayload-plugin-resolve-alias/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746302,"owners_count":24813557,"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-08-23T02:00:09.327Z","response_time":69,"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":["payload","payload-plugin","payloadcms"],"created_at":"2024-10-03T18:20:23.109Z","updated_at":"2025-08-23T09:11:08.165Z","avatar_url":"https://github.com/thgh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Resolve alias webpack helper for Payload CMS\n\n\u003ca href=\"LICENSE\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg\" alt=\"Software License\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/thgh/payload-plugin-resolve-alias/issues\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/issues/thgh/payload-plugin-resolve-alias.svg\" alt=\"Issues\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://npmjs.org/package/payload-plugin-resolve-alias\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/payload-plugin-resolve-alias.svg?style=flat-squar\" alt=\"NPM\" /\u003e\n\u003c/a\u003e\n\n## Encountered this?\n\n```\nERROR in ./node_modules/next/dist/compiled/micromatch/index.js 22:3471-3486\nModule not found: Error: Can't resolve 'util' in '\\node_modules\\next\\dist\\compiled\\micromatch'\n\nBREAKING CHANGE: webpack \u003c 5 used to include polyfills for node.js core modules by default.\nThis is no longer the case. Verify if you need this module and configure a polyfill for it.\n\nIf you want to include a polyfill, you need to:\n        - add a fallback 'resolve.fallback: { \"util\": require.resolve(\"util/\") }'\n        - install 'util'\nIf you don't want to include a polyfill, you can use an empty module like this:\n        resolve.fallback: { \"util\": false }\n```\n\n## Features\n\n- Easy way to fix the webpack error\n- Built-in list of common server-only modules\n\n## Installation\n\n```\nnpm install payload-plugin-resolve-alias\n# or\nyarn add payload-plugin-resolve-alias\n```\n\n## Usage\n\n```js\n// payload.config.ts\nimport { resolveAlias, serverOnlyModules } from 'payload-plugin-resolve-alias'\n\nexport default buildConfig({\n  plugins: [\n    resolveAlias(serverOnlyModules, ['nodemailer']),\n\n    // Alternative syntax\n    resolveAlias(\n      // Object\n      { nodemailer: false, passport: false },\n      // Arra\n      ['nodemailer', 'passport'],\n      // String\n      'nodemailer',\n      'passport',\n      // Falsy arguments are ignored\n      process.env.NODE_ENV === 'production' \u0026\u0026 ['production-only']\n    ),\n  ],\n})\n```\n\n## Community-driven list of server-only modules\n\n`serverOnlyModules` is an array of modules that you probably don't want in the browser:\n\n- express\n- express-session\n- nodemailer\n- passport\n- util\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nContributions and feedback are very welcome.\n\nTo get it running:\n\n1. Clone the project.\n2. `npm install`\n3. `npm run build`\n\n## Credits\n\n- [Thomas Ghysels](https://github.com/thgh)\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthgh%2Fpayload-plugin-resolve-alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthgh%2Fpayload-plugin-resolve-alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthgh%2Fpayload-plugin-resolve-alias/lists"}