{"id":16450,"date":"2022-01-16T19:25:29","date_gmt":"2022-01-16T10:25:29","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=16450"},"modified":"2023-05-27T21:30:19","modified_gmt":"2023-05-27T12:30:19","slug":"%e3%80%90next-js%e3%80%91%e5%90%84%e7%a8%ae%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=16450","title":{"rendered":"\u3010Next.js\u3011\u5404\u7a2e\u30b3\u30de\u30f3\u30c9\u306b\u3064\u3044\u3066"},"content":{"rendered":"<div>\n<h2>next dev<\/h2>\n<p>\u958b\u767a\u6642\u306b\u306f\u3053\u308c\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u90fd\u5ea6\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u30da\u30fc\u30b8\u306e\u751f\u6210(SSG)\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0(CSR)\u304c\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u30da\u30fc\u30b8\u306e\u53d6\u5f97\u306f\u30da\u30fc\u30b8\u9077\u79fb\u306f\u9045\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u5177\u4f53\u7684\u306a\u6319\u52d5<\/h3>\n<ul>\n<li class=\"p1\">\u300cgetStaticProps\u300d\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u90fd\u5ea6\u5b9f\u884c\u3055\u308c\u308b\u3002<\/li>\n<li class=\"p1\">\u300cgetStaticPaths\u300d\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u3082\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u90fd\u5ea6\u5b9f\u884c\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n<h2>next build<\/h2>\n<p>\u300c\u672c\u756a\u30d3\u30eb\u30c9\u300d\u3067\u3059\u3002<\/p>\n<h3>\u5177\u4f53\u7684\u306a\u6319\u52d5<\/h3>\n<ul>\n<li class=\"p1\">\u300cgetStaticProps\u300d\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u300c<span class=\"s1\">.next\/server<\/span>\u300d\u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u306e\u300c<span class=\"s1\">pages<\/span>\u300d\u306bgetStaticProps\u5185\u3067<span class=\"s1\">prefetch(node-fetch\u306a\u3069)<\/span>\u3057\u305f\u30c7\u30fc\u30bf\u304c\u57cb\u3081\u8fbc\u307e\u308c\u305f\u72b6\u614b\u3067\u51fa\u529b\u3055\u308c\u308b\u3002<\/li>\n<li class=\"p1\">\u300cgetStaticPaths\u300d\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u300c.next\/server\/pages\/[\u30d5\u30a9\u30eb\u30c0\u540d]\/[\u30da\u30fc\u30b8\u756a\u53f7].html\u300d\u304c\u30da\u30fc\u30b8\u6570\u5206\u3060\u3051\u4e00\u62ec\u3067\u4e8b\u524d\u306b\u751f\u6210\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n<h2>next export<\/h2>\n<p>\u4e8b\u524d\u306b<span style=\"color: #ff0000;\"><strong>\u300cnext build\u300d<\/strong><\/span>\u3092\u884c\u308f\u306a\u3044\u3068\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u9759\u7684\u30ea\u30bd\u30fc\u30b9\u3092\u751f\u6210\u3057\u307e\u3059\uff08React\u3068\u540c\u3058\u3088\u3046\u306b\uff09\u3002<span style=\"color: #ff0000;\"><strong>SSR\u3084prefetch\u306f\u300cyarn build\u300d\u3092\u884c\u3063\u305f\u6700\u521d\u3060\u3051\u884c\u308f\u308c\u3066\u3001\u305d\u306e\u5f8c\u306f\u3001\u5b8c\u5168\u306b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0(CSR)\u306b\u306a\u308b\u306e\u3067\u3001SSR\u3084SSG\u3092\u672c\u683c\u7684\u306b\u4f7f\u308f\u306a\u3044\u306e\u3067\u3042\u308c\u3070\u6709\u52b9\u306a\u624b\u6cd5<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u5177\u4f53\u7684\u306a\u6319\u52d5<\/h3>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30eb\u30fc\u30c8\u76f4\u4e0b\u306b<span style=\"color: #ff0000;\"><strong>out<\/strong><strong>\u30d5\u30a9\u30eb\u30c0<\/strong><\/span>\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u6ce8\u610f\u70b9<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u300cnext\/image\u300d\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/strong><\/span>\u306f\u4f7f\u3048\u306a\u3044\u3067\u3059\u3002<\/p>\n<\/div>\n<div>\n<div>\n<div>\n<h2>next start<\/h2>\n<p>Next.js\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3061\u4e0a\u3052\u307e\u3059\u3002SSG\u3092\u30d3\u30eb\u30c9\u6642\u306e\u307f\u306b\u884c\u3046\u306e\u3067\u3001\u30da\u30fc\u30b8\u9077\u79fb\u6642\u306b\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3078\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u6539\u3081\u3066\u884c\u308f\u306a\u3044\u305f\u3081\u975e\u5e38\u306b\u9ad8\u901f\u306b\u52d5\u4f5c\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<div>\n<div>\n<h2>next lint<\/h2>\n<div>eslint\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u30022021\u5e74\u306eNext.js\u30d0\u30fc\u30b8\u30e7\u30f311\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u3067package.json\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30bf\u30b0\u306b\u8ffd\u52a0\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<ul>\n<li>eslint\u3068eslint-config-next\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/li>\n<li>\u307e\u3060\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306beslint\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u300c.eslintrc\u300d\u306e\u4f5c\u6210\u3092\u4fc3\u3055\u308c\u307e\u3059\u3002<\/li>\n<li>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u5834\u5408\u306feslint\u306e\u691c\u67fb\u30eb\u30fc\u30eb\u306b\u5f93\u3063\u3066\u691c\u67fb\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n<h3>eslint-config-next\u306e\u8a2d\u5b9a<\/h3>\n<p>\u4ee5\u4e0b\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>react<\/li>\n<li>react-hooks<\/li>\n<li>import<\/li>\n<li>jsx-a11y<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"next dev \u958b\u767a\u6642\u306b\u306f\u3053\u308c\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u90fd\u5ea6\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u3067\u30da\u30fc\u30b8\u306e\u751f\u6210(SSG)\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b5\u30a4\u30c9\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0(CSR)\u304c\u5b9f\u884c\u3055\u308c\u308b\u306e\u3067\u30da\u30fc\u30b8\u306e\u53d6\u5f97\u306f\u30da\u30fc\u30b8\u9077\u79fb\u306f\u9045\u304f\u306a\u308a\u307e\u3059\u3002 \u5177\u4f53\u7684\u306a\u6319\u52d5 \u300cg [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[119],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16450"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16450"}],"version-history":[{"count":12,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16450\/revisions"}],"predecessor-version":[{"id":20367,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/16450\/revisions\/20367"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16450"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}