{"id":310,"date":"2022-12-31T09:12:39","date_gmt":"2022-12-31T00:12:39","guid":{"rendered":"https:\/\/drroot.page\/wp\/?p=310"},"modified":"2022-12-31T09:12:39","modified_gmt":"2022-12-31T00:12:39","slug":"yarn-dev%e3%81%bf%e3%81%9f%e3%81%84%e3%81%aa%e3%83%8e%e3%83%aa%e3%81%a7ts-node-watch%e3%82%92%e5%ae%9f%e7%8f%be%e3%81%99%e3%82%8b%e3%81%ab%e3%81%af","status":"publish","type":"post","link":"https:\/\/drroot.page\/wp\/?p=310","title":{"rendered":"yarn dev\u307f\u305f\u3044\u306a\u30ce\u30ea\u3067ts-node + watch\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f"},"content":{"rendered":"<p>\u82f1\u8a9e\u304c\u8aad\u3081\u308b\uff1f\u3058\u3083\u3042\u3053\u308c\u8aad\u3093\u3067\u7d42\u308f\u308a\u306a\uff01<br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/58187115\/typescript-paths-not-working-in-an-express-project\">https:\/\/stackoverflow.com\/questions\/58187115\/typescript-paths-not-working-in-an-express-project<\/a><\/p>\n<h1>(\u3063\u25de\u2038\u25dfc)<\/h1>\n<h2>\u4f55\u304c\u554f\u984c\u306a\u306e\u304b<\/h2>\n<p>express\u307f\u305f\u3044\u306a\u9bd6\u3092node + ts\u3068\u304b\u3067\u81ea\u524d\u3067\u74b0\u5883\u5165\u308c\u3066\u3044\u304f\u3068\u3001vue-cli\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u3088\u3046\u306adev\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067\u30db\u30c3\u30c8\u30ea\u30ed\u30fc\u30c9\u3064\u304d\u30d3\u30eb\u30c9\u304c\u6a19\u6e96\u3067\u51fa\u6765\u306a\u3044\u3002<br \/>\n\u3067nodemon\u4f7f\u3063\u3066\u81ea\u524d\u3067\u305d\u306e\u3042\u305f\u308a\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u66f8\u304f\u3093\u3060\u3051\u3069\u5fae\u5999\u306bnodemon\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u4e0d\u89aa\u5207\u3067\u60c5\u5831\u304c\u3068\u3063\u3061\u3089\u304b\u3063\u3066\u308b\u306e\u3067\u307e\u3068\u3081\u3066\u304a\u304f\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>devDepencies\u306b<code>nodemon<\/code>, <code>ts-node<\/code>, <code>tsconfig-paths<\/code>\u3092\u8ffd\u52a0\u3057\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30eb\u30fc\u30c8\u306b<code>nodemon.json<\/code>\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\ntsconfig-paths\u306ftsconfig\u3067paths\u3092\u4f7f\u308f\u306a\u3044\uff08\u30a4\u30f3\u30dd\u30fc\u30c8\u6642\u306e\u30d1\u30b9\u3092@\/\u3068\u304b\u304b\u3089\u59cb\u3081\u3089\u308c\u308b\u30a8\u30a4\u30ea\u30a2\u30b9\u7684\u306a\u3084\u3064\uff09\u306a\u3089\u3044\u3089\u306a\u3044\u3051\u3069\u3042\u308b\u3068\u4fbf\u5229\u3060\u3088<br \/>\njson\u306e\u4e2d\u8eab\u306f\u3053\u3093\u306a\u611f\u3058<\/p>\n<pre><code>{\n  &quot;ignore&quot;: [\n    &quot;**\/*.test.ts&quot;,\n    &quot;**\/*.spec.ts&quot;,\n    &quot;.git&quot;,\n    &quot;node_modules&quot;\n  ],\n  &quot;watch&quot;: [\n    &quot;src&quot;\n  ],\n  &quot;exec&quot;: &quot;node -r tsconfig-paths\/register -r ts-node\/register .\/src\/index.ts&quot;,\n  &quot;ext&quot;: &quot;ts, js&quot;\n}<\/code><\/pre>\n<p>\u3042\u3068\u306fpackage.json\u5185\u306escript\u3067<code>&quot;dev&quot;:&quot;yarn nodemon&quot;<\/code>\u3068\u3067\u3082\u66f8\u3044\u3066\u304a\u3051\u3070\u3088\u308d\u3057\u3002<\/p>\n<h2>\u4f59\u8ac7<\/h2>\n<p>nodemon\u306f\u4f55\u51e6\u306b\u3082\u66f8\u3044\u3066\u306a\u3044\u3093\u3060\u304c\u3069\u3046\u3082\u6a19\u6e96\u3067ts-node\u3092\u4f7f\u3063\u3066\u304f\u308c\u308b\u3089\u3057\u304f\u3001\u524d\u8ff0\u306e\u30d1\u30b9\u306e\u554f\u984c\u304c\u6c17\u306b\u306a\u3089\u306a\u3044\u306a\u3089<br \/>\n<code>yarn nodemon src\/index.ts<\/code>\u3068\u304b\u3067\u4e00\u767a\u3089\u3057\u3044\u3088\u3002\u3073\u3063\u304f\u308a\u3060\u306d\u3002\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u66f8\u3044\u3068\u3051\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u82f1\u8a9e\u304c\u8aad\u3081\u308b\uff1f\u3058\u3083\u3042\u3053\u308c\u8aad\u3093\u3067\u7d42\u308f\u308a\u306a\uff01 https:\/\/stackoverfl &hellip; <a href=\"https:\/\/drroot.page\/wp\/?p=310\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-310","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=310"}],"version-history":[{"count":0,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/310\/revisions"}],"wp:attachment":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}