{"id":318307,"date":"2021-02-04T23:18:20","date_gmt":"2021-02-04T15:18:20","guid":{"rendered":"http:\/\/4563.org\/?p=318307"},"modified":"2021-02-04T23:18:20","modified_gmt":"2021-02-04T15:18:20","slug":"%e6%b1%82%e5%8a%a9-package-json-%e6%96%87%e4%bb%b6%e4%b8%ad%e6%89%a7%e8%a1%8c%e8%84%9a%e6%9c%ac%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=318307","title":{"rendered":"[\u6c42\u52a9] package.json \u6587\u4ef6\u4e2d\u6267\u884c\u811a\u672c\u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  [\u6c42\u52a9] package.json \u6587\u4ef6\u4e2d\u6267\u884c\u811a\u672c\u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 0bSer7er <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u524d\u7aef\u840c\u65b0\uff0c\u9700\u6c42\u662f\u6dfb\u52a0\u4e00\u4e2a npm run xxx \u7684\u547d\u4ee4\u6765\u4e0b\u8f7d\u6700\u8fd1\u7684\u56fd\u9645\u5316\u6587\u4ef6<\/p>\n<p>package.json:<\/p>\n<pre><code>scripts:{  \"lang\": \"wget -O .\/src\/lang\/lang.zip http:\/\/xxxx\" } <\/code><\/pre>\n<p>\u8fd9\u6837\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u53ef\u4ee5\u6b63\u5e38\u4e0b\u8f7d\uff0c\u4f46\u662f\u56e0\u4e3a\u4e0b\u8f7d\u7684\u662f zip \u9700\u8981\u518d\u6267\u884c\u89e3\u538b\u7f29\uff0c\u6240\u4ee5\u60f3\u8981\u5199\u4e00\u4e2a shell \u628a 2 \u4e2a\u547d\u4ee4\u653e\u4e00\u8d77\uff08\u9886\u5bfc\u8bf4\u7684\uff09\uff0c\u6b64\u65f6<\/p>\n<p>lang.sh<\/p>\n<pre><code>#!\/bin\/bash wget -O .\/src\/lang\/lang.zip http:\/\/xxxx <\/code><\/pre>\n<p>package.json:<\/p>\n<pre><code>scripts:{  \"lang\": \"lang.sh\" } <\/code><\/pre>\n<p>\u63a7\u5236\u53f0\u6267\u884c npm run lang \u6587\u4ef6\u4e0d\u4f1a\u4e0b\u8f7d<\/p>\n<p>\u8bf7\u95ee\u662f\u5565\u95ee\u9898\uff1f\u5982\u4f55\u89e3\u51b3\uff1f<\/p>\n<p>\u53e6\u5916\u6211\u7535\u8111\u6ca1\u6709 unzip \u547d\u4ee4\u7684\u60c5\u51b5\u4e0b\uff08 Windows\uff0c\u7528\u7f51\u4e0a\u7684\u65b9\u6cd5\u88c5\u4e86 zsh \uff09\u5982\u4f55\u89e3\u538b\u7f29\u6587\u4ef6\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4968286\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ysc3839 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6240\u4ee5\u4f60\u8fd9\u662f\u5728 Windows \u4e0b\uff1f Windows \u6ca1\u6709 bash\uff0c\u5efa\u8bae\u6539\u7528 Node.js \u5199\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4968287\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jingcoco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8211; linux \u53ef\u4ee5 \u201csh .\/xx.sh\u201d\uff0c\u8981\u4e0d\u5c31\u5728\u73af\u5883\u53d8\u91cf\u91cc\u914d\u7f6e\u4e0a\uff0c\u8ba9\u7cfb\u7edf\u77e5\u9053\u53bb\u54ea\u627e lang.sh \u6587\u4ef6<\/p>\n<p>&#8211; window \u53ef\u4ee5\u88c5 wsl <\/p>\n<p>&#8211; \u6211\u4e2a\u4eba\u611f\u89c9\u4f60\u9700\u6c42\u5c31\u662f\u6709\u70b9\u95ee\u9898\u5427\u3002\u611f\u89c9\u53ef\u4ee5\u518d\u95ee\u95ee\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4968288\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shinytea2017 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u50cf 1 \u6240\u8bf4, \u4f7f\u7528 Node.js \u8c03\u7528;<\/p>\n<p>\u6bd4\u5982\u62f7\u8d1d\u6587\u4ef6:<\/p>\n<p>const fs = require(&#8216;fs&#8217;);<\/p>\n<p>\/*<br \/>fs.copyFile(&#8216;.\/node_modules\/uri-js\/dist\/es5\/uri.all.js.map&#8217;, &#8216;.\/src\/uri.all.js.map&#8217;, (err) =&gt; { });<br \/>*\/<br \/>fs.copyFile(&#8216;.\/patches\/uri.all.js.map&#8217;, &#8216;.\/src\/uri.all.js.map&#8217;, (err) =&gt; { });<\/p>\n<p>\u6ca1\u6709\u5fc5\u8981\u9650\u5b9a\u4f7f\u7528\u5916\u90e8\u7a0b\u5e8f\u6765\u5b8c\u6210\u4e0b\u8f7d\u4e0e\u89e3\u538b; \u4efb\u4f55\u652f\u6301\u4e0b\u8f7d\u4e0e\u89e3\u538b\u7684 node.js \u5e93\u90fd\u53ef\u4f7f\u7528.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4968289\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Mutoo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;lang&#8221;: &#8220;cmd1 &amp;&amp; cmd2&#8221;<\/p>\n<p>\u7528 &amp;&amp; \u628a\u4e24\u4e2a\u547d\u4ee4\u4e32\u8d77\u6765\u5c31\u884c\u4e86\uff0c\u8de8\u5e73\u53f0\u652f\u6301\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4968290\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 0bSer7er <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysc3839 <br \/>@jingcoco <br \/>@shinytea2017 <br \/>@Mutoo <br \/>\u611f\u8c22\u56de\u590d\uff0c\u5df2\u7528 node.js \u89e3\u51b3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>[\u6c42\u52a9] package.json&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/318307"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318307"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/318307\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318307"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}