{"id":16297968,"url":"https://github.com/morriq/microservices-webpack-plugin","last_synced_at":"2025-03-20T05:30:35.739Z","repository":{"id":57296734,"uuid":"160950674","full_name":"morriq/microservices-webpack-plugin","owner":"morriq","description":" Prevent loading scripts which are already loaded in another micro-app ","archived":false,"fork":false,"pushed_at":"2020-08-04T16:16:07.000Z","size":623,"stargazers_count":15,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T14:52:55.966Z","etag":null,"topics":["chunk","microservice","microservices-webpack-plugin","tailor","webpack"],"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/morriq.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":"2018-12-08T15:09:48.000Z","updated_at":"2023-09-08T08:49:40.000Z","dependencies_parsed_at":"2022-09-02T07:40:17.756Z","dependency_job_id":null,"html_url":"https://github.com/morriq/microservices-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morriq%2Fmicroservices-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morriq%2Fmicroservices-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morriq%2Fmicroservices-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morriq%2Fmicroservices-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morriq","download_url":"https://codeload.github.com/morriq/microservices-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244559670,"owners_count":20472206,"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":["chunk","microservice","microservices-webpack-plugin","tailor","webpack"],"created_at":"2024-10-10T20:43:13.472Z","updated_at":"2025-03-20T05:30:35.379Z","avatar_url":"https://github.com/morriq.png","language":"JavaScript","readme":"# microservices-webpack-plugin\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/morriq/microservices-webpack-plugin.svg)](https://greenkeeper.io/)\n\nThis `plugin` solves problem with repeating packages from `node_modules` in microservices' chunks.\nIt uses [unpkg](https://unpkg.com) to load npm packages.\n\n## Installation\n\n`npm install -D microservices-webpack-plugin`\n\nLet's try with `react`.\nModify your microservice's `webpack.config`:\n- `output.libraryTarget` must be `amd`\n- add to `plugins`\n```\nnew MicroservicesWebpackPlugin({\n  modules: [\n    { name: 'react', path: `umd/react.production.min.js` },\n  ]\n})\n```\n\n\n## Scenario\n\nYou're using microservices with solutions such as [Tailor](https://github.com/zalando/tailor/).\n\nYou have many microservices which relays on the same version of `some node_modules dependency`.\n\nYou wonder how to don't load `some node_modules dependency` in every chunk.\n\n## Problem\n\nTailor sends client application to browser via `headers` (more specifically via `Link`). And later it uses `require.js` to execute in browser.\nIt expects that `some node_modules dependency` is inside client application or was loaded earlier.\nTo solve that you could:\n\n\u003e add required libraries to tailor's template.\n\n\u003e create microservice which should gather common libraries into its chunk.\n\nIt's not the best approach because it makes invisible relation between microservices\n\n- write in `some node_modules dependency` into `Header.Link`\n\nYour chunk has required dependency `some node_modules dependency` and first of all it will try load `some node_modules dependency` from tailor's host\n\nInspiration [Webpack CDN Plugin](https://github.com/van-nguyen/webpack-cdn-plugin)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorriq%2Fmicroservices-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorriq%2Fmicroservices-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorriq%2Fmicroservices-webpack-plugin/lists"}