{"id":13191,"date":"2026-03-17T06:27:08","date_gmt":"2026-03-17T06:27:08","guid":{"rendered":"https:\/\/withcode.tech\/media\/?p=13191"},"modified":"2026-07-01T15:28:31","modified_gmt":"2026-07-01T15:28:31","slug":"micro-frontends-guide","status":"publish","type":"post","link":"https:\/\/withcode.tech\/media\/micro-frontends-guide\/","title":{"rendered":"\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cModule Federation\u306e\u4ed5\u7d44\u307f\u304b\u3089Vite\u30fbwebpack\u5b9f\u88c5\u30fbMFE\u9593\u901a\u4fe1\u30fbCI\/CD\u30c7\u30d7\u30ed\u30a4\u6226\u7565\u307e\u3067\u5fb9\u5e95\u89e3\u8aac"},"content":{"rendered":"<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-14.48.08.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u751f\u5f92<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u304c\u5927\u898f\u6a21\u5316\u3057\u3066\u304d\u3066\u3001\u30c1\u30fc\u30e0\u3054\u3068\u306b\u72ec\u7acb\u3057\u3066\u30c7\u30d7\u30ed\u30a4\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3093\u3067\u3059\u304c\u2026\u2026\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3063\u3066\u5b9f\u969b\u306b\u3069\u3046\u5b9f\u88c5\u3059\u308b\u3093\u3067\u3059\u304b\uff1f<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-right\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.11.23.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>Module Federation\u3092\u4f7f\u3048\u3070\u305d\u308c\u304c\u5b9f\u73fe\u3067\u304d\u308b\u3093\u3058\u3083\uff01\u8907\u6570\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30a2\u30d7\u30ea\u3092\u30e9\u30f3\u30bf\u30a4\u30e0\u3067\u7d50\u5408\u3057\u3066\u3001\u3042\u305f\u304b\u30821\u3064\u306e\u30a2\u30d7\u30ea\u306e\u3088\u3046\u306b\u52d5\u304b\u305b\u308b\u305e\u3002Vite\u3067\u306fvitePlugin-federation\u3067\u540c\u69d8\u306e\u3053\u3068\u304c\u3067\u304d\u308b\u3002MFE\u9593\u901a\u4fe1\u30fbTypeScript\u578b\u5171\u6709\u30fbCI\/CD\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306e\u8a2d\u8a08\u307e\u3067\u5168\u90e8\u89e3\u8aac\u3059\u308b\u305e\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<div class=\"wp-block-group swl-box\"><div class=\"wp-block-group__inner-container\">\n<h2 class=\"wp-block-heading\">\u3053\u306e\u8a18\u4e8b\u3067\u308f\u304b\u308b\u3053\u3068<\/h2>\n<ul class=\"wp-block-list\">\n<li>\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u6982\u5ff5\u3068\u30e2\u30ce\u30ea\u30b9\u306e\u8ab2\u984c\u306e\u89e3\u6c7a\u7b56<\/li>\n<li>Module Federation\u306eHost\/Remote\u69cb\u9020\u3068\u30e9\u30f3\u30bf\u30a4\u30e0\u5171\u6709\u306e\u4ed5\u7d44\u307f<\/li>\n<li>Vite\uff08vite-plugin-federation\uff09\u3068webpack Module Federation\u306e\u8a2d\u5b9a\u30b3\u30fc\u30c9\u5168\u6587<\/li>\n<li>MFE\u9593\u901a\u4fe1\uff08\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u30fb\u5171\u6709\u30b9\u30c8\u30a2\u30fbURL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\uff09\u306e\u5b9f\u88c5\u65b9\u6cd5<\/li>\n<li>TypeScript\u578b\u5171\u6709\u30fbCI\/CD\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u30fb\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306f\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3092\u6a5f\u80fd\u5358\u4f4d\u3067\u5206\u5272\u3057\u3001\u305d\u308c\u305e\u308c\u3092\u72ec\u7acb\u3057\u3066\u958b\u767a\u30fb\u30c7\u30d7\u30ed\u30a4\u3067\u304d\u308b\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u3059\u3002<\/strong>Module Federation\u3092\u4f7f\u3048\u3070\u3001\u8907\u6570\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30a2\u30d7\u30ea\u3092\u30e9\u30f3\u30bf\u30a4\u30e0\u3067\u7d50\u5408\u3057\u3001\u3042\u305f\u304b\u30821\u3064\u306e\u30a2\u30d7\u30ea\u306e\u3088\u3046\u306b\u52d5\u304b\u305b\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306f\u6982\u5ff5\u304b\u3089\u5b9f\u88c5\u30b3\u30fc\u30c9\u5168\u6587\u30fbCI\/CD\u8a2d\u8a08\u307e\u3067\u4e00\u6c17\u901a\u8cab\u3067\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3068\u306f\uff5c\u30e2\u30ce\u30ea\u30b9\u306e\u9650\u754c\u3068\u89e3\u6c7a\u7b56<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" src=\"img\/micro_frontend_overview.png\" alt=\"\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3068\u30e2\u30ce\u30ea\u30b9\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u6bd4\u8f03\u56f3\" class=\"wp-image-12550\"\/><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code\"><code>>\u3010\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u304c\u89e3\u6c7a\u3059\u308b\u554f\u984c\u3011\n\n\u30e2\u30ce\u30ea\u30b7\u30c3\u30af\u306a\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u8ab2\u984c\uff1a\n\u274c \u5927\u898f\u6a21\u30c1\u30fc\u30e0\u3067\u540c\u3058\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u3078\u306e\u5909\u66f4\u304c\u885d\u7a81\n\u274c \u4e00\u90e8\u6a5f\u80fd\u306e\u66f4\u65b0\u3067\u3082\u30a2\u30d7\u30ea\u5168\u4f53\u3092\u30d3\u30eb\u30c9\u30fb\u30c7\u30d7\u30ed\u30a4\u304c\u5fc5\u8981\n\u274c \u6280\u8853\u30b9\u30bf\u30c3\u30af\u3092\u5909\u66f4\u3057\u306b\u304f\u3044\uff08\u5168\u90e8React\u306a\u3069\u7e1b\u308a\u304c\u767a\u751f\uff09\n\u274c \u30d3\u30eb\u30c9\u6642\u9593\u304c\u3069\u3093\u3069\u3093\u9577\u304f\u306a\u308b\uff0810\u5206\u8d85\u3048\u3082\uff09\n\u274c \u30d0\u30b0\u4fee\u6b63\u304c\u3069\u3053\u304b\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u306a\u3044\u304b\u6bce\u56de\u4e0d\u5b89\n\n\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\uff08MFE\uff09\u306e\u6069\u6075\uff1a\n\u2705 \u6a5f\u80fd\u3054\u3068\u306b\u72ec\u7acb\u3057\u305f\u30ea\u30dd\u30b8\u30c8\u30ea\u30fb\u30c7\u30d7\u30ed\u30a4\u30b5\u30a4\u30af\u30eb\n\u2705 \u5404\u30c1\u30fc\u30e0\u304c\u597d\u307f\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\/\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u9078\u629e\u53ef\u80fd\n\u2705 \u969c\u5bb3\u306e\u5f71\u97ff\u7bc4\u56f2\u3092MFE\u5358\u4f4d\u306b\u9650\u5b9a\u3067\u304d\u308b\n\u2705 \u6bb5\u968e\u7684\u306a\u30ea\u30d7\u30ec\u30fc\u30b9\u304c\u53ef\u80fd\uff08\u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u3092\u5c11\u3057\u305a\u3064\u7f6e\u304d\u63db\u3048\uff09\n\u2705 \u30d3\u30eb\u30c9\u6642\u9593\u304c\u5404MFE\u306b\u5206\u6563\u3059\u308b\u305f\u3081\u5168\u4f53\u30d3\u30eb\u30c9\u304c\u9ad8\u901f\u5316<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u304c\u5411\u3044\u3066\u3044\u308b\/\u5411\u3044\u3066\u3044\u306a\u3044\u30b1\u30fc\u30b9<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\u3010MFE\u306b\u5411\u3044\u3066\u3044\u308b\u30b1\u30fc\u30b9\u3011\n\n\u2705 \u5927\u898f\u6a21\u7d44\u7e54\uff0850\u4eba\u4ee5\u4e0a\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\uff09\u3067\u8907\u6570\u30c1\u30fc\u30e0\u304c\u958b\u767a\n\u2705 \u30c9\u30e1\u30a4\u30f3\uff08\u6a5f\u80fd\uff09\u304c\u660e\u78ba\u306b\u5206\u304b\u308c\u3066\u3044\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\n   \u4f8b\uff09EC\u30b5\u30a4\u30c8\uff1a\u5546\u54c1\u30ab\u30bf\u30ed\u30b0\u30fb\u30ab\u30fc\u30c8\u30fb\u6c7a\u6e08\u30fb\u30de\u30a4\u30da\u30fc\u30b8\u304c\u72ec\u7acb\n\u2705 \u65e2\u5b58\u30e2\u30ce\u30ea\u30b9\u3092\u6bb5\u968e\u7684\u306b\u5237\u65b0\u3057\u305f\u3044\u5834\u5408\n\u2705 \u5404\u6a5f\u80fd\u306e\u30c7\u30d7\u30ed\u30a4\u983b\u5ea6\u304c\u7570\u306a\u308b\u5834\u5408\uff08\u4e00\u90e8\u3060\u3051\u983b\u7e41\u306b\u66f4\u65b0\uff09\n\n\u3010MFE\u306b\u5411\u3044\u3066\u3044\u306a\u3044\u30b1\u30fc\u30b9\u3011\n\n\u274c \u5c0f\u301c\u4e2d\u898f\u6a21\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08\u30c1\u30fc\u30e05\u4eba\u4ee5\u4e0b\uff09\n   \u2192 \u30aa\u30fc\u30d0\u30fc\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u306b\u306a\u308a\u3084\u3059\u3044\n\u274c \u6a5f\u80fd\u306e\u5883\u754c\u304c\u660e\u78ba\u3067\u306a\u3044\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\n\u274c \u9ad8\u3044\u4e00\u8cab\u6027\u306eUI\u304c\u6c42\u3081\u3089\u308c\u308b\uff08\u30c7\u30b6\u30a4\u30f3\u30b7\u30b9\u30c6\u30e0\u306e\u7ba1\u7406\u304c\u8907\u96d1\u5316\uff09\n\u274c SEO\u304c\u6700\u91cd\u8981\u306e\u5834\u5408\uff08SSR\u3068\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u8907\u96d1\uff09\n\u274c \u958b\u767a\u8005\u306e\u30a4\u30f3\u30d5\u30e9\u77e5\u8b58\u304c\u4e0d\u8db3\u3057\u3066\u3044\u308b\u5834\u5408<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u5b9f\u88c5\u30a2\u30d7\u30ed\u30fc\u30c1\u6bd4\u8f03<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">MFE\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306b\u306f\u8907\u6570\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u3042\u308a\u307e\u3059\u3002Module Federation\u306f\u305d\u306e\u4e2d\u3067\u3082\u7279\u306b\u67d4\u8edf\u3067\u5f37\u529b\u306a\u65b9\u6cd5\u3067\u3059\u304c\u3001\u9078\u629e\u306e\u524d\u306b\u5168\u4f53\u50cf\u3092\u628a\u63e1\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<table>\n<thead>\n<tr><th>\u30a2\u30d7\u30ed\u30fc\u30c1<\/th><th>\u6982\u8981<\/th><th>\u30e1\u30ea\u30c3\u30c8<\/th><th>\u30c7\u30e1\u30ea\u30c3\u30c8<\/th><th>\u5411\u3044\u3066\u3044\u308b\u30b1\u30fc\u30b9<\/th><\/tr>\n<\/thead>\n<tbody>\n<tr><td><strong>iFrame<\/strong><\/td><td>\u5404MFE\u3092iframe\u3067\u57cb\u3081\u8fbc\u3080<\/td><td>\u5b8c\u5168\u306a\u5206\u96e2\u30fb\u3069\u3093\u306a\u6280\u8853\u3067\u3082\u52d5\u304f<\/td><td>URL\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30fb\u30b5\u30a4\u30ba\u30fb\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u56f0\u96e3<\/td><td>\u65e2\u5b58\u30da\u30fc\u30b8\u306e\u90e8\u5206\u57cb\u3081\u8fbc\u307f<\/td><\/tr>\n<tr><td><strong>Web Components<\/strong><\/td><td>\u30ab\u30b9\u30bf\u30e0\u8981\u7d20\u3067MFE\u3092\u5b9f\u88c5<\/td><td>\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u975e\u4f9d\u5b58\u30fb\u30d6\u30e9\u30a6\u30b6\u30cd\u30a4\u30c6\u30a3\u30d6<\/td><td>Shadow DOM\u3068\u306e\u517c\u306d\u5408\u3044\u30fbSSR\u975e\u5bfe\u5fdc<\/td><td>\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u6df7\u5728\u74b0\u5883<\/td><\/tr>\n<tr><td><strong>Module Federation<\/strong><\/td><td>\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\u3067\u30e9\u30f3\u30bf\u30a4\u30e0\u5171\u6709<\/td><td>\u4f9d\u5b58\u95a2\u4fc2\u5171\u6709\u30fb\u5171\u901a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5229\u7528\u30fbTypeScript\u5bfe\u5fdc<\/td><td>\u540c\u3058\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u63a8\u5968\u30fb\u8a2d\u5b9a\u304c\u8907\u96d1<\/td><td>\u540c\u4e00\u6280\u8853\u30b9\u30bf\u30c3\u30af\u306e\u5927\u898f\u6a21\u958b\u767a<\/td><\/tr>\n<tr><td><strong>single-spa<\/strong><\/td><td>MFE\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30bf\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea<\/td><td>\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u6df7\u5728\u30fb\u30eb\u30fc\u30c8\u30a2\u30d7\u30ea\u7ba1\u7406<\/td><td>\u5b66\u7fd2\u30b3\u30b9\u30c8\u9ad8\u30fb\u8a2d\u5b9a\u91cf\u304c\u591a\u3044<\/td><td>React\/Vue\/Angular\u6df7\u5728<\/td><\/tr>\n<tr><td><strong>npm\u30d1\u30c3\u30b1\u30fc\u30b8<\/strong><\/td><td>\u5171\u901a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092npm\u516c\u958b<\/td><td>\u578b\u5b89\u5168\u30fb\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u304c\u660e\u78ba<\/td><td>\u30c7\u30d7\u30ed\u30a4\u306e\u305f\u3073\u306b\u518d\u30d3\u30eb\u30c9\u304c\u5fc5\u8981<\/td><td>\u30c7\u30b6\u30a4\u30f3\u30b7\u30b9\u30c6\u30e0\u30fbUI\u30e9\u30a4\u30d6\u30e9\u30ea<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Module Federation\u3068\u306f\uff5cHost\/Remote\u306e\u6982\u5ff5\u3092\u7406\u89e3\u3059\u308b<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>>\u3010Module Federation\u306e2\u3064\u306e\u6982\u5ff5\u3011\n\nHost\uff08\u30db\u30b9\u30c8\uff09\uff1a\n\u2192 \u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3092\u30ed\u30fc\u30c9\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u30a2\u30d7\u30ea\n\u2192 \u300cApp Shell\u300d\u3068\u3082\u547c\u3070\u308c\u308b\n\u2192 \u4ed6\u30a2\u30d7\u30ea\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u81ea\u30a2\u30d7\u30ea\u304b\u306e\u3088\u3046\u306b\u4f7f\u3046\n\u2192 \u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30fb\u8a8d\u8a3c\u3092\u62c5\u5f53\u3059\u308b\u3053\u3068\u304c\u591a\u3044\n\nRemote\uff08\u30ea\u30e2\u30fc\u30c8\uff09\uff1a\n\u2192 \u30db\u30b9\u30c8\u306b\u8aad\u307f\u8fbc\u307e\u308c\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u63d0\u4f9b\u3059\u308b\u30a2\u30d7\u30ea\n\u2192 \u81ea\u8eab\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092 remoteEntry.js \u3068\u3057\u3066\u516c\u958b\n\u2192 \u500b\u5225\u306b\u30d3\u30eb\u30c9\u30fb\u30c7\u30d7\u30ed\u30a4\u53ef\u80fd\n\u2192 \u30db\u30b9\u30c8\u306a\u3057\u3067\u3082\u72ec\u7acb\u3057\u3066\u52d5\u4f5c\u3067\u304d\u308b\u3053\u3068\u304c\u7406\u60f3\n\n\u3010\u30e9\u30f3\u30bf\u30a4\u30e0\u5171\u6709\u306e\u4ed5\u7d44\u307f\u3011\n\n\u30d3\u30eb\u30c9\u6642\uff1a\nRemote \u2192 remoteEntry.js \u3092\u751f\u6210\uff08\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\uff09\n\n\u30e9\u30f3\u30bf\u30a4\u30e0\uff08\u30d6\u30e9\u30a6\u30b6\uff09\uff1a\n1. \u30db\u30b9\u30c8\u30a2\u30d7\u30ea\u304c\u30d6\u30e9\u30a6\u30b6\u3067\u8d77\u52d5\n2. lazy(() => import('remoteApp\/Component')) \u304c\u8a55\u4fa1\u3055\u308c\u308b\n3. \u30db\u30b9\u30c8\u304c remoteEntry.js \u3092\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d8a\u3057\u306b\u30d5\u30a7\u30c3\u30c1\n4. remoteEntry.js \u304b\u3089\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u5b9f\u969b\u306e\u30c1\u30e3\u30f3\u30af\u3092\u53d6\u5f97\n5. \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u308b\n\n\u2192 Remote\u304c\u72ec\u7acb\u3057\u3066\u30c7\u30d7\u30ed\u30a4\u3055\u308c\u3066\u3082\u30db\u30b9\u30c8\u306e\u518d\u30c7\u30d7\u30ed\u30a4\u4e0d\u8981\uff01<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u69cb\u6210\u3068\u74b0\u5883\u69cb\u7bc9<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>># \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u69cb\u6210\uff08\u30e2\u30ce\u30ec\u30dd\u4f8b\uff09\nmfe-monorepo\/\n\u251c\u2500\u2500 app-shell\/         \u2190 \u30db\u30b9\u30c8\u30a2\u30d7\u30ea\uff08\u30dd\u30fc\u30c8: 4000\uff09\n\u2502   \u251c\u2500\u2500 src\/\n\u2502   \u2502   \u251c\u2500\u2500 App.tsx\n\u2502   \u2502   \u2514\u2500\u2500 main.tsx\n\u2502   \u2514\u2500\u2500 vite.config.ts\n\u251c\u2500\u2500 overview\/          \u2190 \u30ea\u30e2\u30fc\u30c8MFE1\uff08\u30dd\u30fc\u30c8: 5000\uff09\n\u2502   \u251c\u2500\u2500 src\/\n\u2502   \u2502   \u2514\u2500\u2500 components\/Overview.tsx\n\u2502   \u2514\u2500\u2500 vite.config.ts\n\u251c\u2500\u2500 stats\/             \u2190 \u30ea\u30e2\u30fc\u30c8MFE2\uff08\u30dd\u30fc\u30c8: 5001\uff09\n\u2502   \u251c\u2500\u2500 src\/\n\u2502   \u2502   \u2514\u2500\u2500 components\/Stats.tsx\n\u2502   \u2514\u2500\u2500 vite.config.ts\n\u251c\u2500\u2500 details\/           \u2190 \u30ea\u30e2\u30fc\u30c8MFE3\uff08\u30dd\u30fc\u30c8: 5002\uff09\n\u2502   \u251c\u2500\u2500 src\/\n\u2502   \u2502   \u2514\u2500\u2500 components\/Details.tsx\n\u2502   \u2514\u2500\u2500 vite.config.ts\n\u251c\u2500\u2500 shared\/            \u2190 \u5171\u6709\u306e\u578b\u5b9a\u7fa9\u30fb\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\n\u2502   \u251c\u2500\u2500 src\/\n\u2502   \u2502   \u251c\u2500\u2500 types\/\n\u2502   \u2502   \u2514\u2500\u2500 utils\/\n\u2502   \u2514\u2500\u2500 package.json\n\u2514\u2500\u2500 package.json       \u2190 \u30ef\u30fc\u30af\u30b9\u30da\u30fc\u30b9\u8a2d\u5b9a<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>># \u30e2\u30ce\u30ec\u30dd\u306epackage.json\uff08pnpm workspaces\uff09\n{\n  \"name\": \"mfe-monorepo\",\n  \"private\": true,\n  \"workspaces\": [\n    \"app-shell\",\n    \"overview\",\n    \"stats\",\n    \"details\",\n    \"shared\"\n  ],\n  \"scripts\": {\n    \"dev\": \"concurrently \\\"pnpm -F overview dev\\\" \\\"pnpm -F stats dev\\\" \\\"pnpm -F details dev\\\" \\\"pnpm -F app-shell dev\\\"\",\n    \"build\": \"pnpm -F overview build && pnpm -F stats build && pnpm -F details build && pnpm -F app-shell build\",\n    \"preview\": \"concurrently \\\"pnpm -F overview preview\\\" \\\"pnpm -F stats preview\\\" \\\"pnpm -F details preview\\\" \\\"pnpm -F app-shell preview\\\"\"\n  },\n  \"devDependencies\": {\n    \"concurrently\": \"^8.0.0\"\n  }\n}\n\n# \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\npnpm install\n# \u5404\u30a2\u30d7\u30ea\u306bvite-plugin-federation\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\npnpm -F overview add -D @originjs\/vite-plugin-federation\npnpm -F stats add -D @originjs\/vite-plugin-federation\npnpm -F details add -D @originjs\/vite-plugin-federation\npnpm -F app-shell add -D @originjs\/vite-plugin-federation<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u88c5\u30b3\u30fc\u30c9\u5168\u6587\uff5cRemote\uff08\u30ea\u30e2\u30fc\u30c8\uff09\u5074\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">overview\/vite.config.ts\uff08\u30ea\u30e2\u30fc\u30c8\u5074\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ overview\/vite.config.ts\n\nimport { defineConfig } from 'vite'\nimport react from '@vitejs\/plugin-react'\nimport federation from '@originjs\/vite-plugin-federation'\n\nexport default defineConfig({\n  plugins: [\n    react(),\n    federation({\n      name: 'remote_overview_app',   \/\/ \u30e2\u30b8\u30e5\u30fc\u30eb\u540d\uff08\u5168MFE\u3067\u4e00\u610f\u3067\u3042\u308b\u3053\u3068\uff09\n      filename: 'remoteEntry.js',    \/\/ \u30a8\u30f3\u30c8\u30ea\u30fc\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u30db\u30b9\u30c8\u304c\u53c2\u7167\u3059\u308b\uff09\n      exposes: {\n        \/\/ \u5916\u90e8\u306b\u516c\u958b\u3059\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30de\u30c3\u30d4\u30f3\u30b0\n        \/\/ '\u516c\u958b\u540d': '\u5b9f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9'\n        '.\/Overview': '.\/src\/components\/Overview',\n        '.\/Header': '.\/src\/components\/Header',\n        '.\/useOverviewData': '.\/src\/hooks\/useOverviewData',  \/\/ \u30ab\u30b9\u30bf\u30e0Hook\u3082\u516c\u958b\u53ef\u80fd\n      },\n      shared: {\n        \/\/ \u5171\u6709\u3059\u308b\u4f9d\u5b58\u95a2\u4fc2\u306e\u8a73\u7d30\u8a2d\u5b9a\n        react: {\n          singleton: true,    \/\/ 1\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u307f\uff08\u30d0\u30fc\u30b8\u30e7\u30f3\u4e0d\u4e00\u81f4\u3092\u9632\u3050\uff09\n          requiredVersion: '^18.0.0',\n        },\n        'react-dom': {\n          singleton: true,\n          requiredVersion: '^18.0.0',\n        },\n      },\n    })\n  ],\n  build: {\n    target: 'esnext',  \/\/ vite-plugin-federation\u306fesnext\u304c\u5fc5\u8981\n    minify: false,     \/\/ \u958b\u767a\u6642\u306ffalse\u304c\u63a8\u5968\uff08\u30c7\u30d0\u30c3\u30b0\u3057\u3084\u3059\u3044\uff09\n  },\n  server: {\n    port: 5000,\n    cors: true,  \/\/ \u30db\u30b9\u30c8\u304b\u3089\u306e\u7570\u306a\u308b\u30aa\u30ea\u30b8\u30f3\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\n  },\n  preview: {\n    port: 5000,\n    strictPort: true,\n    cors: true,\n  }\n})<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">overview\/src\/components\/Overview.tsx\uff08\u516c\u958b\u3059\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ overview\/src\/components\/Overview.tsx\n\/\/ shared\u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089\u5171\u901a\u306e\u578b\u3092\u53c2\u7167\uff08\u578b\u5171\u6709\u306e\u4f8b\uff09\n\nexport interface MonsterData {\n  id: string\n  name: string\n  type: string\n  rarity: 'common' | 'rare' | 'epic' | 'legendary'\n  description: string\n}\n\ninterface OverviewProps {\n  monster: MonsterData\n  onSelect?: (id: string) => void\n}\n\nexport function Overview({ monster, onSelect }: OverviewProps) {\n  const rarityColor = {\n    common: '#9e9e9e',\n    rare: '#1565c0',\n    epic: '#6a1b9a',\n    legendary: '#f57f17',\n  }[monster.rarity]\n\n  return (\n    <div style={{\n      background: '#e8f5e9',\n      padding: '1.5rem',\n      borderRadius: '8px',\n      border: `2px solid ${rarityColor}`,\n      marginBottom: '1rem',\n    }}>\n      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n        <h2 style={{ margin: 0 }}>{monster.name}<\/h2>\n        <span style={{\n          background: rarityColor,\n          color: 'white',\n          padding: '0.25rem 0.75rem',\n          borderRadius: '20px',\n          fontSize: '0.875rem',\n          fontWeight: 'bold',\n        }}>\n          {monster.rarity.toUpperCase()}\n        <\/span>\n      <\/div>\n      <p style={{ color: '#666', marginTop: '0.5rem' }}>\u30bf\u30a4\u30d7: {monster.type}<\/p>\n      <p style={{ marginTop: '0.5rem' }}>{monster.description}<\/p>\n      {onSelect && (\n        <button\n          onClick={() => onSelect(monster.id)}\n          style={{\n            marginTop: '1rem',\n            padding: '0.5rem 1rem',\n            background: '#2e7d32',\n            color: 'white',\n            border: 'none',\n            borderRadius: '4px',\n            cursor: 'pointer',\n          }}\n        >\n          \u8a73\u7d30\u3092\u898b\u308b\n        <\/button>\n      )}\n    <\/div>\n  )\n}\n\nexport default Overview<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u88c5\u30b3\u30fc\u30c9\u5168\u6587\uff5cHost\uff08\u30db\u30b9\u30c8\uff09\u5074\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">app-shell\/vite.config.ts\uff08\u30db\u30b9\u30c8\u5074\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ app-shell\/vite.config.ts\n\nimport { defineConfig } from 'vite'\nimport react from '@vitejs\/plugin-react'\nimport federation from '@originjs\/vite-plugin-federation'\n\nexport default defineConfig({\n  plugins: [\n    react(),\n    federation({\n      name: 'app_shell',\n      remotes: {\n        \/\/ '\u30ed\u30fc\u30ab\u30eb\u53c2\u7167\u540d': '\u30ea\u30e2\u30fc\u30c8\u306eremoteEntry.js\u306eURL'\n        \/\/ \u958b\u767a\u74b0\u5883\n        overviewApp: 'http:\/\/localhost:5000\/assets\/remoteEntry.js',\n        statsApp: 'http:\/\/localhost:5001\/assets\/remoteEntry.js',\n        detailsApp: 'http:\/\/localhost:5002\/assets\/remoteEntry.js',\n        \/\/ \u672c\u756a\u74b0\u5883\uff08\u74b0\u5883\u5909\u6570\u3067\u5207\u308a\u66ff\u3048\uff09\n        \/\/ overviewApp: `${process.env.VITE_OVERVIEW_URL}\/assets\/remoteEntry.js`,\n      },\n      shared: {\n        react: { singleton: true, requiredVersion: '^18.0.0' },\n        'react-dom': { singleton: true, requiredVersion: '^18.0.0' },\n      },\n    })\n  ],\n  build: {\n    target: 'esnext',\n  },\n  server: {\n    port: 4000,\n  }\n})<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">app-shell\/src\/App.tsx\uff08\u30ea\u30e2\u30fc\u30c8\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5229\u7528\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ app-shell\/src\/App.tsx\n\nimport { Suspense, lazy, useState, useCallback } from 'react'\nimport { BrowserRouter, Routes, Route, Link } from 'react-router-dom'\n\n\/\/ \u30ea\u30e2\u30fc\u30c8\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u52d5\u7684\u30a4\u30f3\u30dd\u30fc\u30c8\uff08\u9045\u5ef6\u30ed\u30fc\u30c9\uff09\n\/\/ 'overviewApp\/Overview' = vite.config.ts \u306e remotes.overviewApp + exposes '.\/Overview'\nconst Overview = lazy(() => import('overviewApp\/Overview'))\nconst Stats = lazy(() => import('statsApp\/Stats'))\nconst Details = lazy(() => import('detailsApp\/Details'))\n\n\/\/ \u30ea\u30e2\u30fc\u30c8\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306eTypeScript\u578b\u5ba3\u8a00\uff08d.ts\u30d5\u30a1\u30a4\u30eb\u3067\u7ba1\u7406\uff09\n\/\/ \u578b\u306b\u3064\u3044\u3066\u306f\u5f8c\u8ff0\n\n\/\/ \u30a8\u30e9\u30fc\u30d0\u30a6\u30f3\u30c0\u30ea\u3067MFE\u306e\u30a8\u30e9\u30fc\u3092\u9694\u96e2\u3059\u308b\nimport { ErrorBoundary } from 'react-error-boundary'\n\nfunction MFEErrorFallback({ error, resetErrorBoundary }: {\n  error: Error\n  resetErrorBoundary: () => void\n}) {\n  return (\n    <div style={{\n      padding: '1rem',\n      background: '#ffebee',\n      border: '1px solid #ef9a9a',\n      borderRadius: '8px',\n      margin: '1rem 0',\n    }}>\n      <h3>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f<\/h3>\n      <p style={{ color: '#c62828', fontFamily: 'monospace', fontSize: '0.875rem' }}>\n        {error.message}\n      <\/p>\n      <button\n        onClick={resetErrorBoundary}\n        style={{ padding: '0.5rem 1rem', cursor: 'pointer' }}\n      >\n        \u518d\u8a66\u884c\n      <\/button>\n    <\/div>\n  )\n}\n\n\/\/ \u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30b1\u30eb\u30c8\u30f3\nfunction Skeleton() {\n  return (\n    <div style={{\n      background: 'linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)',\n      backgroundSize: '200% 100%',\n      animation: 'shimmer 1.5s infinite',\n      height: '120px',\n      borderRadius: '8px',\n      margin: '1rem 0',\n    }} \/>\n  )\n}\n\nconst monster = {\n  id: 'dragon-001',\n  name: '\u30a8\u30eb\u30c0\u30fc\u30c9\u30e9\u30b4\u30f3',\n  type: '\u708e',\n  rarity: 'legendary' as const,\n  description: '\u592a\u53e4\u306e\u6642\u4ee3\u304b\u3089\u751f\u304d\u7d9a\u3051\u308b\u9f8d\u3002\u305d\u306e\u708e\u306f\u92fc\u9244\u3059\u3089\u6eb6\u304b\u3059\u3068\u3055\u308c\u308b\u3002',\n  hp: 9999,\n  attack: 850,\n  defense: 600,\n  speed: 120,\n}\n\nfunction App() {\n  const [selectedId, setSelectedId] = useState<string | null>(null)\n\n  const handleSelect = useCallback((id: string) => {\n    setSelectedId(id)\n  }, [])\n\n  return (\n    <BrowserRouter>\n      <div style={{ padding: '2rem', fontFamily: 'sans-serif', maxWidth: '800px', margin: '0 auto' }}>\n        <nav style={{ marginBottom: '2rem', display: 'flex', gap: '1rem' }}>\n          <Link to=\"\/\">\u6982\u8981<\/Link>\n          <Link to=\"\/stats\">\u30b9\u30c6\u30fc\u30bf\u30b9<\/Link>\n          <Link to=\"\/details\">\u8a73\u7d30<\/Link>\n        <\/nav>\n\n        <Routes>\n          <Route path=\"\/\" element={\n            <ErrorBoundary FallbackComponent={MFEErrorFallback} onReset={() => {}}>\n              <Suspense fallback={<Skeleton \/>}>\n                <Overview monster={monster} onSelect={handleSelect} \/>\n              <\/Suspense>\n            <\/ErrorBoundary>\n          } \/>\n          <Route path=\"\/stats\" element={\n            <ErrorBoundary FallbackComponent={MFEErrorFallback} onReset={() => {}}>\n              <Suspense fallback={<Skeleton \/>}>\n                <Stats monsterId={monster.id} hp={monster.hp} attack={monster.attack} defense={monster.defense} \/>\n              <\/Suspense>\n            <\/ErrorBoundary>\n          } \/>\n          <Route path=\"\/details\" element={\n            <ErrorBoundary FallbackComponent={MFEErrorFallback} onReset={() => {}}>\n              <Suspense fallback={<Skeleton \/>}>\n                <Details monsterId={selectedId || monster.id} \/>\n              <\/Suspense>\n            <\/ErrorBoundary>\n          } \/>\n        <\/Routes>\n      <\/div>\n    <\/BrowserRouter>\n  )\n}\n\nexport default App<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">TypeScript\u578b\u5b9a\u7fa9\u306e\u5171\u6709\uff5c\u578b\u5ba3\u8a00\u30d5\u30a1\u30a4\u30eb\u3067MFE\u3092\u578b\u5b89\u5168\u306b\u3059\u308b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Module Federation\u3067\u30ea\u30e2\u30fc\u30c8\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092import\u3059\u308b\u3068\u304d\u3001TypeScript\u306f\u30ea\u30e2\u30fc\u30c8\u306e\u30b3\u30fc\u30c9\u3092\u8a8d\u8b58\u3067\u304d\u306a\u3044\u305f\u3081\u578b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<strong>\u578b\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\uff08.d.ts\uff09\u3092\u624b\u52d5\u307e\u305f\u306f\u81ea\u52d5\u751f\u6210\u3057\u3066\u5171\u6709\u3059\u308b\u3053\u3068\u3067\u578b\u5b89\u5168\u3092\u7dad\u6301<\/strong>\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ app-shell\/src\/types\/remote-modules.d.ts\n\/\/ \u30ea\u30e2\u30fc\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u578b\u5ba3\u8a00\u30d5\u30a1\u30a4\u30eb\n\ndeclare module 'overviewApp\/Overview' {\n  import { FC } from 'react'\n\n  export interface MonsterData {\n    id: string\n    name: string\n    type: string\n    rarity: 'common' | 'rare' | 'epic' | 'legendary'\n    description: string\n  }\n\n  export interface OverviewProps {\n    monster: MonsterData\n    onSelect?: (id: string) => void\n  }\n\n  const Overview: FC<OverviewProps>\n  export default Overview\n}\n\ndeclare module 'statsApp\/Stats' {\n  import { FC } from 'react'\n\n  export interface StatsProps {\n    monsterId: string\n    hp: number\n    attack: number\n    defense: number\n    speed?: number\n  }\n\n  const Stats: FC<StatsProps>\n  export default Stats\n}\n\ndeclare module 'detailsApp\/Details' {\n  import { FC } from 'react'\n\n  export interface DetailsProps {\n    monsterId: string\n  }\n\n  const Details: FC<DetailsProps>\n  export default Details\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">@module-federation\/dts-plugin \u3092\u4f7f\u3063\u305f\u81ea\u52d5\u578b\u751f\u6210<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ @module-federation\/dts-plugin \u3092\u4f7f\u3063\u305f\u578b\u5b9a\u7fa9\u306e\u81ea\u52d5\u751f\u6210\uff08webpack MF 2.0\uff09\n\/\/ vite-plugin-federation\u3067\u306f\u73fe\u6642\u70b9\u3067\u672a\u5bfe\u5fdc\u306e\u305f\u3081\u624b\u52d5\u5ba3\u8a00\u304c\u4e3b\u6d41\n\n# \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08webpack Module Federation 2.0 \u306e\u5834\u5408\uff09\nnpm install @module-federation\/dts-plugin --save-dev\n\n\/\/ webpack.config.js \u3067\u306e\u8a2d\u5b9a\nconst { ModuleFederationPlugin } = require('@module-federation\/enhanced\/webpack')\n\nmodule.exports = {\n  plugins: [\n    new ModuleFederationPlugin({\n      name: 'overviewApp',\n      exposes: {\n        '.\/Overview': '.\/src\/components\/Overview',\n      },\n      dts: {\n        generateTypes: true,   \/\/ \u578b\u5b9a\u7fa9\u3092\u81ea\u52d5\u751f\u6210\n        consumeTypes: false,   \/\/ \u30db\u30b9\u30c8\u5074\u3067true\u306b\u3057\u3066\u81ea\u52d5\u53d6\u5f97\n      },\n    }),\n  ],\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">MFE\u9593\u306e\u901a\u4fe1\u65b9\u6cd5\uff5c\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u30fb\u5171\u6709\u30b9\u30c8\u30a2\u30fbURL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u6700\u5927\u306e\u96e3\u3057\u3055\u306e\u4e00\u3064\u304c\u300cMFE\u9593\u3067\u306e\u30c7\u30fc\u30bf\u5171\u6709\u300d\u3067\u3059\u3002\u4ee5\u4e0b\u306e3\u3064\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<table>\n<thead>\n<tr><th>\u30a2\u30d7\u30ed\u30fc\u30c1<\/th><th>\u7d50\u5408\u5ea6<\/th><th>\u5411\u3044\u3066\u3044\u308b\u30b1\u30fc\u30b9<\/th><th>\u6ce8\u610f\u70b9<\/th><\/tr>\n<\/thead>\n<tbody>\n<tr><td>\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8<\/td><td>\u758e\u7d50\u5408<\/td><td>MFE\u540c\u58eb\u304c\u72ec\u7acb\u3057\u3066\u3044\u308b\u5834\u5408<\/td><td>\u30a4\u30d9\u30f3\u30c8\u540d\u306e\u4e00\u5143\u7ba1\u7406\u304c\u5fc5\u8981<\/td><\/tr>\n<tr><td>\u5171\u6709\u30b9\u30c8\u30a2\uff08Zustand\u7b49\uff09<\/td><td>\u5bc6\u7d50\u5408<\/td><td>\u983b\u7e41\u306b\u72b6\u614b\u5171\u6709\u304c\u5fc5\u8981\u306a\u5834\u5408<\/td><td>singleton\u3068\u3057\u3066\u5171\u6709\u8a2d\u5b9a\u304c\u5fc5\u9808<\/td><\/tr>\n<tr><td>URL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc<\/td><td>\u6700\u3082\u758e\u7d50\u5408<\/td><td>\u30da\u30fc\u30b8\u9077\u79fb\u3068\u9023\u52d5\u3059\u308b\u5834\u5408<\/td><td>URL\u306e\u80a5\u5927\u5316\u306b\u6ce8\u610f<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n<h3 class=\"wp-block-heading\">\u30a2\u30d7\u30ed\u30fc\u30c11\uff1a\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\uff08\u63a8\u5968\u30fb\u758e\u7d50\u5408\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ shared\/src\/events\/mfe-events.ts\n\/\/ MFE\u9593\u3067\u5171\u6709\u3059\u308b\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u306e\u5b9a\u7fa9\n\n\/\/ \u30a4\u30d9\u30f3\u30c8\u540d\u306e\u5b9a\u6570\uff08\u30bf\u30a4\u30dd\u3092\u9632\u3050\uff09\nexport const MFE_EVENTS = {\n  MONSTER_SELECTED: 'mfe:monster-selected',\n  CART_UPDATED: 'mfe:cart-updated',\n  USER_LOGGED_IN: 'mfe:user-logged-in',\n  NAVIGATION_CHANGE: 'mfe:navigation-change',\n} as const\n\n\/\/ \u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u767a\u706b\u30d8\u30eb\u30d1\u30fc\nexport function dispatchMFEEvent<T>(eventName: string, detail: T): void {\n  const event = new CustomEvent(eventName, {\n    detail,\n    bubbles: true,     \/\/ \u89aa\u8981\u7d20\u306b\u30d0\u30d6\u30ea\u30f3\u30b0\n    composed: true,    \/\/ Shadow DOM\u306e\u5883\u754c\u3092\u8d8a\u3048\u308b\n  })\n  window.dispatchEvent(event)\n}\n\n\/\/ \u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u8cfc\u8aad\u30d8\u30eb\u30d1\u30fc\nexport function subscribeMFEEvent<T>(\n  eventName: string,\n  handler: (detail: T) => void\n): () => void {  \/\/ \u30a2\u30f3\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6\u95a2\u6570\u3092\u8fd4\u3059\n  const listener = (event: Event) => {\n    handler((event as CustomEvent<T>).detail)\n  }\n  window.addEventListener(eventName, listener)\n  return () => window.removeEventListener(eventName, listener)\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ overview\/src\/components\/Overview.tsx \u3067\u4f7f\u7528\nimport { dispatchMFEEvent, MFE_EVENTS } from '..\/..\/shared\/events\/mfe-events'\n\nfunction Overview({ monster }: OverviewProps) {\n  const handleSelect = () => {\n    \/\/ \u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u3067\u4ed6\u306eMFE\u306b\u901a\u77e5\n    dispatchMFEEvent(MFE_EVENTS.MONSTER_SELECTED, {\n      id: monster.id,\n      name: monster.name,\n      timestamp: Date.now(),\n    })\n  }\n\n  return (\n    <div>\n      <h2>{monster.name}<\/h2>\n      <button onClick={handleSelect}>\u9078\u629e<\/button>\n    <\/div>\n  )\n}\n\n\/\/ details\/src\/components\/Details.tsx \u3067\u53d7\u4fe1\nimport { subscribeMFEEvent, MFE_EVENTS } from '..\/..\/shared\/events\/mfe-events'\nimport { useEffect, useState } from 'react'\n\nfunction Details() {\n  const [selectedMonster, setSelectedMonster] = useState<string | null>(null)\n\n  useEffect(() => {\n    \/\/ \u30a4\u30d9\u30f3\u30c8\u3092\u8cfc\u8aad\u3057\u3066\u30e2\u30f3\u30b9\u30bf\u30fcID\u3092\u53d7\u3051\u53d6\u308b\n    const unsubscribe = subscribeMFEEvent<{ id: string }>(\n      MFE_EVENTS.MONSTER_SELECTED,\n      ({ id }) => setSelectedMonster(id)\n    )\n    return unsubscribe  \/\/ \u30a2\u30f3\u30de\u30a6\u30f3\u30c8\u6642\u306b\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\n  }, [])\n\n  return <div>\u9078\u629e\u4e2d: {selectedMonster}<\/div>\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a2\u30d7\u30ed\u30fc\u30c12\uff1a\u5171\u6709\u30b9\u30c8\u30a2\uff08Zustand \/ Jotai\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ shared\/src\/store\/mfe-store.ts\n\/\/ Zustand\u3092Module Federation\u3067\u5171\u6709\u3059\u308b\n\nimport { create } from 'zustand'\nimport { devtools } from 'zustand\/middleware'\n\ninterface GlobalState {\n  selectedMonsterId: string | null\n  user: { id: string; name: string } | null\n  setSelectedMonster: (id: string | null) => void\n  setUser: (user: GlobalState['user']) => void\n}\n\nexport const useGlobalStore = create<GlobalState>()(\n  devtools(\n    (set) => ({\n      selectedMonsterId: null,\n      user: null,\n      setSelectedMonster: (id) => set({ selectedMonsterId: id }),\n      setUser: (user) => set({ user }),\n    }),\n    { name: 'MFE Global Store' }\n  )\n)\n\n\/\/ vite.config.ts \u3067 zustand \u3092 shared \u306b\u8ffd\u52a0\u3057\u3066\u5171\u6709\n\/\/ shared: {\n\/\/   zustand: { singleton: true, requiredVersion: '^4.0.0' },\n\/\/ }<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a2\u30d7\u30ed\u30fc\u30c13\uff1aURL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\uff08\u6700\u3082\u30b7\u30f3\u30d7\u30eb\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ URL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u4f7f\u3063\u305fMFE\u9593\u306e\u72b6\u614b\u5171\u6709\n\/\/ \u30d6\u30e9\u30a6\u30b6\u30d0\u30c3\u30af\u30fb\u30ea\u30ed\u30fc\u30c9\u306b\u3082\u5bfe\u5fdc\u3067\u304d\u308b\u30b7\u30f3\u30d7\u30eb\u306a\u65b9\u6cd5\n\n\/\/ overview MFE \u3067URL\u3092\u5909\u66f4\nfunction Overview({ monster }: OverviewProps) {\n  const navigate = useNavigate()\n\n  const handleSelect = () => {\n    \/\/ URL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306b\u9078\u629e\u72b6\u614b\u3092\u53cd\u6620\n    navigate(`\/details?monsterId=${monster.id}`)\n  }\n\n  return <button onClick={handleSelect}>\u8a73\u7d30\u3078<\/button>\n}\n\n\/\/ details MFE \u3067URL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u8aad\u307f\u53d6\u308b\nfunction Details() {\n  const [searchParams] = useSearchParams()\n  const monsterId = searchParams.get('monsterId')\n\n  \/\/ monsterId \u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u30d5\u30a7\u30c3\u30c1\n  const { data } = useQuery({\n    queryKey: ['monster', monsterId],\n    queryFn: () => fetchMonsterDetails(monsterId!),\n    enabled: !!monsterId,\n  })\n\n  return <div>{data?.name}<\/div>\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">webpack Module Federation\u3068\u306e\u6bd4\u8f03<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Module Federation\u306fwebpack 5\u3067\u6700\u521d\u306b\u5c0e\u5165\u3055\u308c\u305f\u6a5f\u80fd\u3067\u3059\u3002Vite\u306e vite-plugin-federation \u3068 webpack Module Federation\u306e\u4e3b\u306a\u9055\u3044\u3092\u7406\u89e3\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<table>\n<thead>\n<tr><th>\u6bd4\u8f03\u9805\u76ee<\/th><th>webpack Module Federation<\/th><th>vite-plugin-federation<\/th><\/tr>\n<\/thead>\n<tbody>\n<tr><td>\u6210\u719f\u5ea6<\/td><td>\u9ad8\u3044\uff08webpack 5\u3067\u516c\u5f0f\u30b5\u30dd\u30fc\u30c8\uff09<\/td><td>\u4e2d\uff08\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30d7\u30e9\u30b0\u30a4\u30f3\uff09<\/td><\/tr>\n<tr><td>SSR\u5bfe\u5fdc<\/td><td>\u5b8c\u5168\u5bfe\u5fdc<\/td><td>\u5236\u9650\u3042\u308a\uff08\u5b9f\u9a13\u7684\uff09<\/td><\/tr>\n<tr><td>\u30d3\u30eb\u30c9\u901f\u5ea6<\/td><td>\u9045\u3044\uff08webpack\u5168\u4f53\u306e\u30d3\u30eb\u30c9\uff09<\/td><td>\u901f\u3044\uff08Vite\u306eesbuild\u6d3b\u7528\uff09<\/td><\/tr>\n<tr><td>HMR<\/td><td>\u5b8c\u5168\u5bfe\u5fdc<\/td><td>\u5bfe\u5fdc\uff08\u4e00\u90e8\u5236\u9650\u3042\u308a\uff09<\/td><\/tr>\n<tr><td>\u578b\u751f\u6210<\/td><td>@module-federation\/dts-plugin<\/td><td>\u624b\u52d5\u5ba3\u8a00\u304c\u5fc5\u8981<\/td><\/tr>\n<tr><td>\u8a2d\u5b9a\u306e\u8907\u96d1\u3055<\/td><td>\u4e2d\u301c\u9ad8<\/td><td>\u4f4e\u301c\u4e2d<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ webpack.config.js \u3067\u306eModule Federation\u8a2d\u5b9a\uff08\u53c2\u8003\uff09\nconst { ModuleFederationPlugin } = require('@module-federation\/enhanced\/webpack')\n\n\/\/ Remote\u5074\nmodule.exports = {\n  plugins: [\n    new ModuleFederationPlugin({\n      name: 'overviewApp',\n      filename: 'remoteEntry.js',\n      exposes: {\n        '.\/Overview': '.\/src\/components\/Overview',\n      },\n      shared: {\n        react: { singleton: true, requiredVersion: '^18.0.0' },\n        'react-dom': { singleton: true, requiredVersion: '^18.0.0' },\n      },\n    }),\n  ],\n}\n\n\/\/ Host\u5074\nmodule.exports = {\n  plugins: [\n    new ModuleFederationPlugin({\n      name: 'appShell',\n      remotes: {\n        overviewApp: 'overviewApp@http:\/\/localhost:5000\/remoteEntry.js',\n      },\n      shared: {\n        react: { singleton: true },\n        'react-dom': { singleton: true },\n      },\n    }),\n  ],\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f9d\u5b58\u95a2\u4fc2\u306e\u5171\u6709\u6226\u7565\uff08shared\u8a2d\u5b9a\u306e\u8a73\u7d30\uff09<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ vite.config.ts \u306e shared \u8a73\u7d30\u8a2d\u5b9a\nfederation({\n  shared: {\n    react: {\n      singleton: true,        \/\/ \u8907\u6570\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u6df7\u5728\u3057\u3066\u3082\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f1\u3064\n      requiredVersion: '^18.0.0',  \/\/ \u5fc5\u8981\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\n      strictVersion: false,   \/\/ true\u306b\u3059\u308b\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u4e0d\u4e00\u81f4\u3067\u30a8\u30e9\u30fc\n      eager: true,            \/\/ \u975e\u540c\u671f\u3067\u306f\u306a\u304f\u540c\u671f\u7684\u306b\u30ed\u30fc\u30c9\uff08\u521d\u671f\u30ed\u30fc\u30c9\u901f\u5ea6\u5411\u4e0a\uff09\n    },\n    'react-dom': {\n      singleton: true,\n      requiredVersion: '^18.0.0',\n    },\n    \/\/ \u5171\u901a\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3082\u5171\u6709\u53ef\u80fd\n    'date-fns': {\n      requiredVersion: '^3.0.0',\n      \/\/ singleton: false\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09\u2192 \u5404MFE\u304c\u72ec\u81ea\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6301\u3066\u308b\n    },\n    \/\/ \u30c7\u30b6\u30a4\u30f3\u30b7\u30b9\u30c6\u30e0\u3082\u5171\u6709\n    '@myapp\/design-system': {\n      singleton: true,\n      requiredVersion: '^1.0.0',\n    },\n  },\n})<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">remoteEntry.js\u306e\u30d7\u30ea\u30ed\u30fc\u30c9<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ app-shell\/index.html \u3067remoteEntry.js\u3092\u30d7\u30ea\u30ed\u30fc\u30c9\n<!DOCTYPE html>\n<html>\n<head>\n  <!-- \u5404Remote\u306eremoteEntry.js\u3092\u5148\u8aad\u307f\u3057\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30ec\u30a4\u30c6\u30f3\u30b7\u3092\u524a\u6e1b -->\n  <link rel=\"preload\" href=\"http:\/\/localhost:5000\/assets\/remoteEntry.js\" as=\"script\" \/>\n  <link rel=\"preload\" href=\"http:\/\/localhost:5001\/assets\/remoteEntry.js\" as=\"script\" \/>\n  <link rel=\"preload\" href=\"http:\/\/localhost:5002\/assets\/remoteEntry.js\" as=\"script\" \/>\n<\/head>\n<body>\n  <div id=\"root\"><\/div>\n  <script type=\"module\" src=\"\/src\/main.tsx\"><\/script>\n<\/body>\n<\/html><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">CDN\u3092\u4f7f\u3063\u305fremoteEntry.js\u306e\u914d\u4fe1<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>>\/\/ \u672c\u756a\u74b0\u5883\u306e vite.config.ts\uff08\u74b0\u5883\u5909\u6570\u3067\u30ea\u30e2\u30fc\u30c8URL\u3092\u5207\u308a\u66ff\u3048\uff09\n\nconst isDev = process.env.NODE_ENV === 'development'\nconst OVERVIEW_URL = isDev\n  ? 'http:\/\/localhost:5000'\n  : process.env.VITE_OVERVIEW_CDN_URL || 'https:\/\/overview.cdn.example.com'\n\nexport default defineConfig({\n  plugins: [\n    federation({\n      remotes: {\n        overviewApp: `${OVERVIEW_URL}\/assets\/remoteEntry.js`,\n      },\n    }),\n  ],\n})<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">CI\/CD\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306e\u8a2d\u8a08\uff5c\u72ec\u7acb\u30c7\u30d7\u30ed\u30a4\u3092\u5b9f\u73fe\u3059\u308b<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>># .github\/workflows\/deploy-overview.yml\n# overview MFE\u306e\u72ec\u7acb\u3057\u305fCI\/CD\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\n\nname: Deploy Overview MFE\n\non:\n  push:\n    branches: [main]\n    paths:\n      - 'overview\/**'   # overview\u914d\u4e0b\u306e\u5909\u66f4\u6642\u306e\u307f\u30c8\u30ea\u30ac\u30fc\n\njobs:\n  build-and-deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\/checkout@v4\n\n      - name: Setup Node.js\n        uses: actions\/setup-node@v4\n        with:\n          node-version: '20'\n          cache: 'pnpm'\n\n      - name: Install dependencies\n        run: pnpm install --frozen-lockfile\n\n      - name: Build Overview MFE\n        working-directory: overview\n        run: pnpm build\n        env:\n          NODE_ENV: production\n\n      - name: Run tests\n        working-directory: overview\n        run: pnpm test\n\n      # S3 + CloudFront\u3078\u306e\u30c7\u30d7\u30ed\u30a4\u4f8b\n      - name: Deploy to S3\n        uses: aws-actions\/configure-aws-credentials@v4\n        with:\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws-region: ap-northeast-1\n\n      - name: Upload to S3\n        run: |\n          aws s3 sync overview\/dist\/ s3:\/\/my-mfe-overview\/ --delete\n          # remoteEntry.js \u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u306a\u3057\uff08\u5373\u6642\u53cd\u6620\uff09\n          aws s3 cp overview\/dist\/assets\/remoteEntry.js \\\n            s3:\/\/my-mfe-overview\/assets\/remoteEntry.js \\\n            --cache-control \"no-cache, no-store, must-revalidate\"\n\n      - name: Invalidate CloudFront\n        run: |\n          aws cloudfront create-invalidation \\\n            --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} \\\n            --paths \"\/assets\/remoteEntry.js\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>>\u3010\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u30c7\u30d7\u30ed\u30a4\u6226\u7565 \u91cd\u8981\u30dd\u30a4\u30f3\u30c8\u3011\n\n1. remoteEntry.js \u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u8a2d\u5b9a\n   \u2192 Cache-Control: no-cache\uff08\u6bce\u56de\u6700\u65b0\u3092\u53d6\u5f97\uff09\n   \u2192 \u307e\u305f\u306f Content-Hash\u4ed8\u304d\u30d5\u30a1\u30a4\u30eb\u540d + \u9577\u671f\u30ad\u30e3\u30c3\u30b7\u30e5\uff08\u975e\u63a8\u5968\uff09\n   \u2192 remoteEntry.js\u306f\u5fc5\u305a\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u53cd\u6620\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\n\n2. Blue-Green\u30c7\u30d7\u30ed\u30a4\u3068\u306e\u7d44\u307f\u5408\u308f\u305b\n   \u2192 \u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306eRemote\u3092\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u3067\u30c6\u30b9\u30c8\u5f8c\u306b\u672c\u756a\u5207\u308a\u66ff\u3048\n\n3. Feature Flags\u3068\u306e\u7d44\u307f\u5408\u308f\u305b\n   \u2192 LaunchDarkly\u3084Unleash\u3067\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5358\u4f4d\u306e\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u30d5\u30e9\u30b0\u7ba1\u7406\n\n4. \u30d0\u30fc\u30b8\u30e7\u30cb\u30f3\u30b0\u6226\u7565\n   \u2192 remoteEntry.js \u306f \u5e38\u306b\u6700\u65b0 or \u30d0\u30fc\u30b8\u30e7\u30f3\u4ed8\u304dURL (\/v1.2.0\/remoteEntry.js)\n   \u2192 \u30d0\u30fc\u30b8\u30e7\u30f3\u4ed8\u304d\u306e\u5834\u5408\u306f\u30db\u30b9\u30c8\u5074\u306e\u8a2d\u5b9a\u5909\u66f4\u304c\u5fc5\u8981\uff08\u30c7\u30d7\u30ed\u30a4\u9023\u643a\u304c\u5fc5\u8981\uff09<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u958b\u767a\u6642\u306e\u30c7\u30d0\u30c3\u30b0\u3068\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>>\u3010\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u89e3\u6c7a\u7b56\u3011\n\n\u274c \u30a8\u30e9\u30fc1: \"Failed to fetch dynamically imported module\"\n\u2192 \u30ea\u30e2\u30fc\u30c8\u30a2\u30d7\u30ea\u304c\u8d77\u52d5\u3057\u3066\u3044\u306a\u3044 or URL\u304c\u9593\u9055\u3063\u3066\u3044\u308b\n\u2192 \u78ba\u8a8d: curl http:\/\/localhost:5000\/assets\/remoteEntry.js \u304c\u8fd4\u3063\u3066\u304f\u308b\u304b\n\u2192 \u89e3\u6c7a: vite preview \u306f build \u5f8c\u306b\u52d5\u4f5c\u3002\u5148\u306b\u5404Remote\u3092 build && preview\n\n\u274c \u30a8\u30e9\u30fc2: \"Uncaught SyntaxError: Unexpected token '<'\"\n\u2192 remoteEntry.js \u306e\u4ee3\u308f\u308a\u306bHTML\u304c\u8fd4\u3063\u3066\u3044\u308b\uff08404\u30da\u30fc\u30b8\u7b49\uff09\n\u2192 \u78ba\u8a8d: \u30d6\u30e9\u30a6\u30b6\u306eNetwork\u30bf\u30d6\u3067remoteEntry.js\u306e\u5b9f\u969b\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u78ba\u8a8d\n\n\u274c \u30a8\u30e9\u30fc3: \"Module not found: 'overviewApp\/Overview'\"\n\u2192 vite.config.ts \u306e remotes \u8a2d\u5b9a\u304c\u9593\u9055\u3063\u3066\u3044\u308b\n\u2192 \u78ba\u8a8d: `overviewApp` \u306e\u30ad\u30fc\u540d\u3068 import('overviewApp\/Overview') \u306e\u540d\u524d\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\n\n\u274c \u30a8\u30e9\u30fc4: \"React is not defined\" \u307e\u305f\u306f \"Cannot read properties of null (reading 'useState')\"\n\u2192 React\u304c\u8907\u6570\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5b58\u5728\u3057\u3066\u3044\u308b\n\u2192 \u89e3\u6c7a: shared \u306b react \u3092 singleton: true \u3067\u8a2d\u5b9a\u3059\u308b\n\n\u274c \u30a8\u30e9\u30fc5: TypeScript\u3067 \"Cannot find module 'overviewApp\/Overview'\"\n\u2192 \u578b\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\n\u2192 \u89e3\u6c7a: remote-modules.d.ts \u3092\u4f5c\u6210\u3057\u3066\u578b\u5ba3\u8a00\u3092\u8ffd\u52a0\u3059\u308b<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Module Federation\u3092\u4f7f\u3046\u3068\u521d\u671f\u30ed\u30fc\u30c9\u304c\u9045\u304f\u306a\u308a\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>lazy()<\/code> + <code>&lt;Suspense&gt;<\/code> \u3067\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u9045\u5ef6\u30ed\u30fc\u30c9\u3059\u308c\u3070\u3001\u5fc5\u8981\u306aMFE\u3060\u3051\u3092\u5fc5\u8981\u306a\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u8aad\u307f\u8fbc\u3081\u308b\u305f\u3081\u521d\u671f\u30ed\u30fc\u30c9\u3078\u306e\u5f71\u97ff\u3092\u6700\u5c0f\u5316\u3067\u304d\u307e\u3059\u3002remoteEntry.js\u306e\u53d6\u5f97\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30e9\u30a6\u30f3\u30c9\u30c8\u30ea\u30c3\u30d7\u304c\u767a\u751f\u3059\u308b\u305f\u3081\u3001<strong>CDN\u3092\u4f7f\u3063\u305f\u914d\u4fe1\u30fbHTTP\/2\u591a\u91cd\u5316\u30fb\u30d7\u30ea\u30ed\u30fc\u30c9\u306e\u7d44\u307f\u5408\u308f\u305b<\/strong>\u3067\u6539\u5584\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7570\u306a\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306eReact\u3092\u4f7f\u3063\u3066\u3044\u308bMFE\u9593\u3067\u3082\u52d5\u304d\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>shared<\/code> \u306e\u8a2d\u5b9a\u3067 <code>singleton: true<\/code> \u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u30671\u3064\u306eReact\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5171\u6709\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3057<strong>\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5927\u304d\u304f\u7570\u306a\u308b\u5834\u5408\uff08React 17 vs 18\u306a\u3069\uff09\u306f\u30e9\u30f3\u30bf\u30a4\u30e0\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059<\/strong>\u3002MFE\u9593\u3067\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u63c3\u3048\u308b\u3053\u3068\u3092\u5f37\u304f\u63a8\u5968\u3057\u307e\u3059\u3002\u3069\u3046\u3057\u3066\u3082\u7570\u306a\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u3001Web Components\u30d9\u30fc\u30b9\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3084iFrame\u3092\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">vite-plugin-federation \u3067SSR\uff08Next.js\uff09\u306f\u4f7f\u3048\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u73fe\u6642\u70b9\uff082026\u5e743\u6708\uff09\u3067\u306f vite-plugin-federation \u306eSSR\u30b5\u30dd\u30fc\u30c8\u306f\u5b9f\u9a13\u7684\u3067\u3059\u3002SSR\u74b0\u5883\u3067Module Federation\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f<strong>webpack Module Federation\uff08\u7279\u306b Module Federation 2.0\uff09<\/strong>\u306e\u4f7f\u7528\u3092\u63a8\u5968\u3057\u307e\u3059\u3002Next.js 14\u4ee5\u964d\u3067\u306f <code>@module-federation\/nextjs-mf<\/code> \u304c\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">MFE\u306e\u30c6\u30b9\u30c8\u6226\u7565\u306f\u3069\u3046\u3059\u3079\u304d\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c6\u30b9\u30c8\u6226\u7565\u306f3\u5c64\u3067\u69cb\u6210\u3057\u307e\u3059\u3002\uff081\uff09<strong>\u5404MFE\u306e\u5358\u4f53\u30c6\u30b9\u30c8<\/strong>\uff1aVitest + Testing Library\u3067\u901a\u5e38\u3069\u304a\u308a\u5b9f\u65bd\u3002\uff082\uff09<strong>\u7d71\u5408\u30c6\u30b9\u30c8<\/strong>\uff1a\u30db\u30b9\u30c8\u30a2\u30d7\u30ea\u306b\u3059\u3079\u3066\u306eMFE\u3092\u30de\u30a6\u30f3\u30c8\u3057\u3066E2E\u306b\u8fd1\u3044\u30c6\u30b9\u30c8\uff08Playwright\u63a8\u5968\uff09\u3002\uff083\uff09<strong>\u30b3\u30f3\u30c8\u30e9\u30af\u30c8\u30c6\u30b9\u30c8<\/strong>\uff1aHost\u3068Remote\u9593\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u578b\u30fb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u4e00\u81f4\u3092\u81ea\u52d5\u691c\u8a3c\u3002MSW\uff08Mock Service Worker\uff09\u3067API\u3092\u30e2\u30c3\u30af\u3057\u306a\u304c\u3089MFE\u5358\u4f53\u3067\u3082\u30c6\u30b9\u30c8\u3067\u304d\u308b\u74b0\u5883\u3092\u6574\u3048\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306e\u30c7\u30b6\u30a4\u30f3\u30b7\u30b9\u30c6\u30e0\u7ba1\u7406\u306f\u3069\u3046\u3059\u308b\u3079\u304d\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c7\u30b6\u30a4\u30f3\u30b7\u30b9\u30c6\u30e0\u306f<strong>\u72ec\u7acb\u3057\u305f\u5171\u6709\u30d1\u30c3\u30b1\u30fc\u30b8<\/strong>\u3068\u3057\u3066\u7ba1\u7406\u3059\u308b\u306e\u304c\u6700\u3082\u30b9\u30b1\u30fc\u30e9\u30d6\u30eb\u3067\u3059\u3002npm\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3057\u3066\u516c\u958b\u3057\u3066\u3059\u3079\u3066\u306eMFE\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3001Module Federation\u306e <code>shared<\/code> \u306b\u30e9\u30f3\u30bf\u30a4\u30e0\u5171\u6709\u3059\u308b\u65b9\u6cd5\u3001Storybook\u3067\u5404MFE\u304c\u72ec\u7acb\u3057\u3066\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u7d44\u307f\u5408\u308f\u305b\u307e\u3059\u3002CSS\u30ab\u30b9\u30bf\u30e0\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u30d7\u30ec\u30fc\u30f3CSS\u3068\u3057\u3066\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3067\u3001\u3069\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306eMFE\u3067\u3082\u7d71\u4e00\u7684\u306a\u30b9\u30bf\u30a4\u30eb\u3092\u9069\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9<\/strong>\uff1a\u5927\u898f\u6a21\u30c1\u30fc\u30e0\u3067\u6709\u52b9\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3002\u5c0f\u898f\u6a21\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u306f\u904e\u5270\u8a2d\u8a08\u306b\u306a\u308a\u3084\u3059\u3044<\/li>\n<li><strong>Module Federation<\/strong>\uff1a\u30d3\u30eb\u30c9\u6642\u3067\u306f\u306a\u304f\u30e9\u30f3\u30bf\u30a4\u30e0\u3067\u5225\u30a2\u30d7\u30ea\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u4ed5\u7d44\u307f\u3002\u5404MFE\u3092\u72ec\u7acb\u3057\u3066\u30d3\u30eb\u30c9\u30fb\u30c7\u30d7\u30ed\u30a4\u3067\u304d\u308b<\/li>\n<li><strong>Vite\u3067\u306e\u5b9f\u88c5<\/strong>\uff1avite-plugin-federation \u3092\u4f7f\u3044\u3001Remote\u5074\u3067exposes\u30fbHost\u5074\u3067remotes\u3092\u8a2d\u5b9a\u3059\u308b\u3002<code>build.target: 'esnext'<\/code> \u304c\u5fc5\u9808<\/li>\n<li><strong>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5229\u7528<\/strong>\uff1a<code>lazy(() => import('overviewApp\/Overview'))<\/code> \u3067\u30ea\u30e2\u30fc\u30c8\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u901a\u5e38\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3068\u540c\u69d8\u306b\u4f7f\u3048\u308b<\/li>\n<li><strong>\u578b\u5b89\u5168<\/strong>\uff1a<code>remote-modules.d.ts<\/code> \u306b\u578b\u5ba3\u8a00\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067TypeScript\u306e\u578b\u30a8\u30e9\u30fc\u3092\u89e3\u6d88<\/li>\n<li><strong>MFE\u9593\u901a\u4fe1<\/strong>\uff1a\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\uff08\u758e\u7d50\u5408\uff09\u30fb\u5171\u6709\u30b9\u30c8\u30a2\uff08\u5bc6\u7d50\u5408\uff09\u30fbURL\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\uff08\u30b7\u30f3\u30d7\u30eb\uff09\u306e3\u3064\u3092\u4f7f\u3044\u5206\u3051\u308b<\/li>\n<li><strong>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/strong>\uff1a\u5404MFE\u3092 ErrorBoundary \u3067\u30e9\u30c3\u30d7\u3057\u3066\u969c\u5bb3\u306e\u5f71\u97ff\u7bc4\u56f2\u3092\u9650\u5b9a\u3059\u308b<\/li>\n<li><strong>CI\/CD<\/strong>\uff1a\u5404MFE\u304c\u72ec\u7acb\u3057\u305f\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u3092\u6301\u3061\u3001\u5909\u66f4\u3055\u308c\u305fMFE\u3060\u3051\u3092\u518d\u30c7\u30d7\u30ed\u30a4\u3067\u304d\u308b\u69cb\u6210\u306b\u3059\u308b<\/li>\n<li><strong>remoteEntry.js\u306e\u30ad\u30e3\u30c3\u30b7\u30e5<\/strong>\uff1a<code>Cache-Control: no-cache<\/code> \u3067\u5fc5\u305a\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u63d0\u4f9b\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3059\u308b<\/li>\n<\/ul>\n\n\n<p class=\"wp-block-paragraph\"><strong><span class=\"swl-marker mark_yellow\">Module Federation\u306f\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u5927\u898f\u6a21\u5316\u306b\u5bfe\u5fdc\u3059\u308b\u6709\u529b\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u3059\u3002\u307e\u305a\u5c0f\u3055\u306a\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08\u30db\u30b9\u30c81\u3064+\u30ea\u30e2\u30fc\u30c81\u3064\uff09\u3067\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u3001\u5b9f\u30d7\u30ed\u30c0\u30af\u30c8\u3078\u306e\u5c0e\u5165\u3092\u691c\u8a0e\u3057\u307e\u3057\u3087\u3046\u3002\u30c1\u30fc\u30e0\u898f\u6a21\u3068\u30c9\u30e1\u30a4\u30f3\u306e\u5206\u96e2\u5ea6\u3092\u898b\u6975\u3081\u3066\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3092\u63a1\u7528\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3059\u308b\u3053\u3068\u304c\u6210\u529f\u306e\u9375\u3067\u3059\u3002<\/span><\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">WithCode\u3092\u4f53\u9a13\u3067\u304d\u308b\u521d\u7d1a\u30b3\u30fc\u30b9\u516c\u958b\u4e2d\uff01<\/h2>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-white-color has-text-color has-background wp-element-button\" href=\"https:\/\/withcode.tech\/reservation\/\" style=\"background-color:#ffbf00\"><strong>\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089\u7121\u6599\u30ab\u30a6\u30f3\u30bb\u30ea\u30f3\u30b0\u306b\u7533\u3057\u8fbc\u3080 \u2192<\/strong><\/a><\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>\u30de\u30a4\u30af\u30ed\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u6982\u5ff5\u304b\u3089Module Federation\u306eHost\/Remote\u8a2d\u5b9a\u30fbVite\uff08vite-plugin-federation\uff09\u5b9f\u88c5\u30b3\u30fc\u30c9\u5168\u6587\u30fbMFE\u9593\u901a\u4fe1\u30fbTypeScript\u578b\u5171\u6709\u30fbCI\/CD\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u8a2d\u8a08\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\u3002webpack Module Federation\u3068\u306e\u6bd4\u8f03\u8868\u3084\u983b\u51fa\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u7b56\u3082\u63b2\u8f09\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"swell_btn_cv_data":"","footnotes":"","vk-ltc-link":"","vk-ltc-target":""},"categories":[34,359],"tags":[],"class_list":["post-13191","post","type-post","status-publish","format-standard","hentry","category-programming","category-javascript-programming"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/13191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/comments?post=13191"}],"version-history":[{"count":2,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/13191\/revisions"}],"predecessor-version":[{"id":13980,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/13191\/revisions\/13980"}],"wp:attachment":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/media?parent=13191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/categories?post=13191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/tags?post=13191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}