{"id":149094,"date":"2020-08-16T13:07:05","date_gmt":"2020-08-16T05:07:05","guid":{"rendered":"http:\/\/4563.org\/?p=149094"},"modified":"2020-08-16T13:07:05","modified_gmt":"2020-08-16T05:07:05","slug":"%e5%a6%82%e4%bd%95%e5%b0%86-vue-%e6%96%87%e4%bb%b6%e7%bc%96%e8%af%91%e6%88%90-es-mdule-%e4%bd%bf%e7%94%a8%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=149094","title":{"rendered":"\u5982\u4f55\u5c06.vue \u6587\u4ef6\u7f16\u8bd1\u6210 es mdule \u4f7f\u7528\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5982\u4f55\u5c06.vue \u6587\u4ef6\u7f16\u8bd1\u6210 es mdule \u4f7f\u7528\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : konnga403 <\/span>  <span><i><\/i> 9<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6280\u672f\u6808\uff1avue2+element-ui+vue-cli4<\/p>\n<p>\u9700\u6c42\uff1a\u73b0\u5728\u9879\u76ee\u4e0a\u9700\u8981\u62c6\u5206\u4ee3\u7801\uff0c\u6211\u60f3\u901a\u8fc7 lerna \u7ba1\u7406\u524d\u7aef\u7684\u4e1a\u52a1\u6a21\u5757\u4ee3\u7801\uff0c\u62bd\u79bb\u4e00\u4e2a\u4e3b\u8981\u7684\u6a21\u5757\uff0c\u7f16\u8bd1\u8fc7\u540e\uff0c\u901a\u8fc7 npm \u5305\u7684\u5f62\u5f0f\u6765\u7ed9\u5176\u4ed6\u4e1a\u52a1\u6a21\u5757\u4f7f\u7528\u3002<\/p>\n<p>\u73b0\u5728\u7684\u65b9\u5f0f\uff1a \u6211\u76ee\u524d\u901a\u8fc7 vue.config.js \u914d\u7f6e webpack\uff0c\u6253\u5305\u51fa lib \u6587\u4ef6\uff0c\u73b0\u5728\u53ef\u4ee5\u6ee1\u8db3\u4e0a\u9762\u7684\u9700\u6c42\uff1b\u4f46\u662f\u5fc5\u987b\u4e0d\u80fd\u62bd\u79bb\u516c\u5171\u6587\u4ef6\uff0c\u4e5f\u5c31\u662f\uff1aconfig.optimization.delete(&#8216;splitChunks&#8217;) \u8fd9\u6837\u5bfc\u81f4 lib \u6587\u4ef6\u8fc7\u5927\uff0c\u4e0d\u5220\u9664 splitChunks \u7684\u8bdd\uff0c\u6253\u5305\u51fa\u6765\u7684\u6587\u4ef6\u8fd0\u884c\u62a5\u9519\uff0c\u65e0\u6cd5\u4f7f\u7528\u3002<\/p>\n<p>\u6211\u5728\u60f3\uff0c\u80fd\u4e0d\u80fd\u4ec5\u7f16\u8bd1.vue \u6587\u4ef6\u6210.js \u6587\u4ef6\uff0c\u7b26\u5408 es module \u7684\u5f62\u5f0f\u6765\u76f4\u63a5\u4f7f\u7528\u5462\uff1f \u8bf7\u6559\u4e00\u4e0b\u5404\u4f4d\u5927\u4f6c      <\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3097263\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ruoxie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6253 npm \u5305\u7684\u8bdd\uff0c\u7528 rollup \u5427\uff0c\u4e4b\u524d\u505a\u7ec4\u4ef6\u5e93\u6253\u5305\u7684\u65f6\u5019 webpack \u6253\u5305\u4e0d\u51fa esm\uff0c\u5c31\u6539\u7528\u4e86 rollup \u3002\u6253\u5305.vue \uff0c.tsx \uff0c.jsx \u90fd\u6ca1\u6709\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3097264\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : erwin985211 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u80fd\u591f\u6253\u5305\u6210 js\uff0c\u4f60\u770b vuecli3 \u7684\u6587\u6863\u91cc\u6709 \u6574\u4e2a\u9879\u76ee\u6253\u5305\u4e00\u4e2a js \u5c01\u88c5\u6210\u4e00\u4e2a Web Components \u6765\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3097265\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Reapper <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4e4b\u524d\u4e5f\u60f3\u505a\u8fd9\u6837\u7684\u529f\u80fd\uff0c\u4f46\u662f\u6ca1\u627e\u5230\u65b9\u6848\u3002rollup \u597d\u50cf\u662f\u4e2a\u4e0d\u9519\u7684\u65b9\u6cd5\uff0c\u611f\u8c22\u4e00\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3097266\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : konnga403 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ruoxie \u6211\u539f\u6765\u6253\u5305\u7ec4\u4ef6\u5e93\u7684\u65f6\u5019\u4e5f\u662f\u7528\u7684 vue-cli \u76f4\u63a5\u5904\u7406\uff0cvue \u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u914d\u7f6e\u591a\u4e2a\u5165\u53e3\uff0c\u4e0d\u7528 splitChunks\uff0c\u6253\u5305\u51fa\u6765\u7684\u7ec4\u4ef6\u6587\u4ef6\u662f es \u6a21\u5757\u53ef\u7528\u7684\uff0c\u4f46\u5c31\u662f\u4f53\u79ef\u5f88\u5927\uff1b\u6211\u53bb\u8bd5\u8bd5 rollup\uff0c\u611f\u8c22\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3097267\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : konnga403 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @erwin985211 \u8fd9\u6837\u662f\u628a\u6240\u6709\u6587\u4ef6\u6253\u5305\u5728\u4e00\u8d77\u4f7f\u7528\u4e86\uff0c\u6211\u60f3\u7684\u662f\u50cf\u7ec4\u4ef6\u5e93\u90a3\u6837\uff0c\u5f15\u7528\u5177\u4f53\u7684\u6a21\u5757\u3002react+lerna \u505a\u8fc7\uff0c\u4f46\u662f vue \u8981\u5904\u7406.vue \u6587\u4ef6\uff0c\u4e0d\u50cf react \u90a3\u6837\u76f4\u63a5\u7528 babel \u7f16\u8bd1\u5c31\u884c&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3097268\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : konnga403 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Reapper \u8001\u54e5\u6709\u7ed3\u679c\u5206\u4eab\u4e00\u4e0b\u5440                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3097269\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : em2046 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ef\u4ee5\u53c2\u8003\u5b98\u65b9 ui \u9879\u76ee\u7684\u505a\u6cd5\uff0c\u4e5f\u662f\u4f7f\u7528\u7684 rollup \u6253\u5305<br \/>https:\/\/github.com\/vuejs\/ui<br \/>\u4e0d\u8fc7\u5982\u679c\u60f3\u8981 css \u4e5f\u80fd\u6309\u9700\u52a0\u8f7d\uff0c\u5c31\u5f97\u53c2\u8003\u76ee\u524d\u6d41\u884c\u7684\u5176\u4ed6\u7ec4\u4ef6\u5e93\u7684\u5199\u6cd5\u4e86\uff0c\u5982 https:\/\/github.com\/ant-design\/babel-plugin-import                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5c06.vue \u6587\u4ef6\u7f16\u8bd1\u6210 es &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\/149094"}],"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=149094"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/149094\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149094"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}