{"id":28315,"date":"2024-11-24T10:55:33","date_gmt":"2024-11-24T02:55:33","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28315\/"},"modified":"2024-11-24T10:55:33","modified_gmt":"2024-11-24T02:55:33","slug":"angular-13-%e7%83%ad%e6%9b%b4%e6%96%b0%e5%a4%b1%e6%95%88%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3-wsl-%e7%8e%af%e5%a2%83%e4%b8%8b%e7%a8%8b%e5%ba%8f%e6%9c%aa%e6%94%be%e7%bd%ae%e5%9c%a8%e5%ad%98","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28315\/","title":{"rendered":"Angular 13 \u70ed\u66f4\u65b0\u5931\u6548\uff0c\u5982\u4f55\u89e3\u51b3 WSL \u73af\u5883\u4e0b\u7a0b\u5e8f\u672a\u653e\u7f6e\u5728\u5b58\u50a8\u76ee\u5f55\u7684\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173149023365666.jpg\" class=\"aligncenter\" title=\"Angular 13 \u70ed\u66f4\u65b0\u5931\u6548\uff0c\u5982\u4f55\u89e3\u51b3 WSL \u73af\u5883\u4e0b\u7a0b\u5e8f\u672a\u653e\u7f6e\u5728\u5b58\u50a8\u76ee\u5f55\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"Angular 13 \u70ed\u66f4\u65b0\u5931\u6548\uff0c\u5982\u4f55\u89e3\u51b3 WSL \u73af\u5883\u4e0b\u7a0b\u5e8f\u672a\u653e\u7f6e\u5728\u5b58\u50a8\u76ee\u5f55\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>angular 13 \u70ed\u66f4\u65b0\u5931\u6548<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u5728\u4e00\u4e2a Angular 13 \u5e94\u7528\u4e2d\uff0c\u542f\u7528\u4e86\u70ed\u66f4\u65b0 (HMR)\uff0c\u4f46\u66f4\u6539\u6e90\u6587\u4ef6\u540e\uff0c\u524d\u7aef\u6ca1\u6709\u66f4\u65b0\u3002<\/p>\n<p><strong>\u7591\u4f3c\u539f\u56e0\uff1a<\/strong><\/p>\n<ul>\n<li>\u73af\u5883\u914d\u7f6e\u9519\u8bef<\/li>\n<li>\u5f00\u53d1\u7a0b\u5e8f\u672a\u653e\u7f6e\u5728 WSL \u5b58\u50a8\u76ee\u5f55\u4e2d<\/li>\n<\/ul>\n<p><strong>\u73af\u5883\u914d\u7f6e\uff1a<\/strong><\/p>\n<ul>\n<li>Node: v16.13.2<\/li>\n<li>npm: 8.3.0<\/li>\n<li>yarn: 1.22<\/li>\n<li>Angular: ~13.3.0<\/li>\n<\/ul>\n<p><strong>\u914d\u7f6e\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>environment.js:<\/p>\n<pre>export const environment = {\nproduction: false,\nhmr: true\n};<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<li>\n<p>angular.json:<\/p>\n<pre>{\n\"serve\": {\n  \"builder\": \"@angular-devkit\/build-angular:dev-server\",\n  \"configurations\": {\n    \"development\": {\n      \"hmr\": true,\n      \"browserTarget\": \"chengzheng-official:build:development\"\n    }\n  }\n}\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236  <\/li>\n<\/ul>\n<p><strong>\u5206\u6790\uff1a<\/strong><\/p>\n<p>\u7ecf\u68c0\u67e5\uff0c\u73af\u5883\u914d\u7f6e\u548c Angular CLI \u63a7\u5236\u53f0\u5df2\u542f\u52a8\u70ed\u66f4\u65b0\uff0c\u4f46\u5b9e\u9645\u5e76\u672a\u751f\u6548\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u539f\u56e0\u5728\u4e8e\uff0c\u6b63\u5728\u4f7f\u7528 WSL \u4e2d\u7684 Node\uff0c\u4f46\u4e3b\u7a0b\u5e8f\u672a\u653e\u7f6e\u5728 WSL \u5b58\u50a8\u76ee\u5f55\u4e2d\u3002Windows \u5e95\u5c42\u4e0d\u652f\u6301\u8de8\u5185\u6838\u7684\u4e8b\u4ef6\u63a8\u9001\uff0c\u56e0\u6b64\u70ed\u66f4\u65b0\u5931\u6548\u3002<\/p>\n<p><strong>\u4fee\u590d\uff1a<\/strong><\/p>\n<p>\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u9700\u8981\u5c06\u5f00\u53d1\u7a0b\u5e8f\u79fb\u52a8\u5230 WSL \u5b58\u50a8\u76ee\u5f55\u4e2d\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c06\u9879\u76ee\u76ee\u5f55\u79fb\u52a8\u5230 \/mnt\/d\/dev\/my-project\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fAngular 13 \u70ed\u66f4\u65b0\u5931\u6548\uff0c\u5982\u4f55\u89e3\u51b3 WSL \u73af\u5883\u4e0b\u7a0b\u5e8f\u672a\u653e\u7f6e\u5728\u5b58\u50a8\u76ee\u5f55\u7684\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>angular 13 \u70ed\u66f4\u65b0\u5931\u6548 \u95ee\u9898\uff1a \u5728\u4e00\u4e2a Angular 13 \u5e94\u7528\u4e2d\uff0c\u542f\u7528\u4e86\u70ed\u66f4\u65b0 (HMR)\uff0c\u4f46\u66f4\u6539\u6e90\u6587\u4ef6\u540e\uff0c\u524d\u7aef\u6ca1\u6709\u66f4\u65b0\u3002 \u7591\u4f3c\u539f\u56e0\uff1a \u73af\u5883\u914d\u7f6e\u9519\u8bef \u5f00\u53d1\u7a0b\u5e8f\u672a\u653e\u7f6e\u5728 WSL \u5b58\u50a8\u76ee\u5f55\u4e2d \u73af\u5883\u914d\u7f6e\uff1a Node: v16.13.2 npm: 8.3.0 yarn: 1.22 Angular: ~13.3.0 \u914d\u7f6e\uff1a environment.js: export const environment = { production: false, hmr: true }; \u767b\u5f55\u540e\u590d\u5236 angular.json: { &#8220;serve&#8221;: { &#8220;builder&#8221;: &#8220;@angular-devkit\/build-angular:dev-server&#8221;, &#8220;configurations&#8221;: { &#8220;development&#8221;: { &#8220;hmr&#8221;: true, &#8220;browserTarget&#8221;: &#8220;chengzheng-official:build:development&#8221; } } } } \u767b\u5f55\u540e\u590d\u5236 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-28315","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=28315"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28315\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}