{"id":208936,"date":"2020-11-25T08:12:15","date_gmt":"2020-11-25T00:12:15","guid":{"rendered":"http:\/\/4563.org\/?p=208936"},"modified":"2020-11-25T08:12:15","modified_gmt":"2020-11-25T00:12:15","slug":"webpack-%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e6%8f%90%e5%8f%96-html-%e6%96%87%e4%bb%b6%e4%b8%ad%e7%9a%84-script-%e5%92%8c-style-%e6%a0%87%e7%ad%be-%e5%b9%b6%e4%bd%bf%e7%94%a8%e5%85%b6%e4%bb%96-loader","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=208936","title":{"rendered":"webpack \u5982\u4f55\u5b9e\u73b0\u63d0\u53d6.html \u6587\u4ef6\u4e2d\u7684 script \u548c style \u6807\u7b7e? \u5e76\u4f7f\u7528\u5176\u4ed6 loader \u5904\u7406\u540e\u751f\u6210\u6587\u4ef6\u5730\u5740?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  webpack \u5982\u4f55\u5b9e\u73b0\u63d0\u53d6.html \u6587\u4ef6\u4e2d\u7684 script \u548c style \u6807\u7b7e? \u5e76\u4f7f\u7528\u5176\u4ed6 loader \u5904\u7406\u540e\u751f\u6210\u6587\u4ef6\u5730\u5740?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : woshiyigexiaohao <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6709\u4e2a\u9700\u6c42\u662f\u9700\u8981\u628a.html \u5185\u7684\u6240\u6709 script \u6807\u7b7e <code>script:not([src])<\/code> \u548c style \u6807\u7b7e \u4f7f\u7528\u5bf9\u5e94\u7684 loader \u8fdb\u884c\u5904\u7406\u5e76\u5c06\u5176\u53d8\u4e3a\u6587\u4ef6\u5f15\u7528\u5f62\u5f0f.<\/p>\n<p>script \u6807\u7b7e\u4e0d\u540c\u4e8e vue \u53ef\u80fd\u5b58\u5728 html \u6587\u4ef6\u4efb\u4f55\u4f4d\u7f6e,\u53ef\u80fd\u9700\u8981\u7ecf\u8fc7 parse \u5904\u7406.<\/p>\n<p>\u7c7b\u4f3c Vue-loader<\/p>\n<\/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=\"4349442\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : woshiyigexiaohao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u5565\u601d\u8def\u561b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4349443\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Torpedo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @woshiyigexiaohao https:\/\/github.com\/jantimon\/html-webpack-plugin#configuration \u53ef\u4ee5\u628a html \u5f53\u505a\u6a21\u677f\uff0c\u6ce8\u5165\u53d8\u91cf\uff0c\u62fc\u6700\u540e\u751f\u6210\u7684 html                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4349444\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : woshiyigexiaohao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Torpedo plugins \u665a\u4e8e loader \u6267\u884c,\u5982\u4f55\u5728 plugin \u4e2d\u5bf9\u6587\u4ef6\u8fd0\u884c loader                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4349445\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yaphets666 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u539f\u7406\u561b\u90a3\u80af\u5b9a\u662f\u6b63\u5219\u5339\u914d\u4e86,vue-loader \u4e5f\u662f\u6b63\u5219.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4349446\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Torpedo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @woshiyigexiaohao \u90a3\u5c31\u5148\u5199\u4e2a\u89e3\u6790 html \u7684 loader\uff0c\u628a\u5269\u4f59\u7684\u6254\u7ed9\u540e\u9762\u7684 js\uff0cstyleloader \u5565\u7684\u3002\u4e0d\u77e5\u9053 html-loader \u884c\u4e0d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4349447\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : KuroNekoFan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             xpath \u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4349448\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : auroraccc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u627e\u4e2a parse html \u7684\u5e93\u7136\u540e\u8fc7 loader \u62ff\u5230\u5904\u7406\u540e\u7684\u6587\u4ef6\u5730\u5740\u518d\u66ff\u6362\u5c31\u597d\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>webpack \u5982\u4f55\u5b9e\u73b0\u63d0\u53d6.ht&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\/208936"}],"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=208936"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/208936\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208936"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}