{"id":453,"date":"2022-05-17T11:51:35","date_gmt":"2022-05-17T03:51:35","guid":{"rendered":"http:\/\/usei.cn\/?p=453"},"modified":"2022-05-17T11:51:36","modified_gmt":"2022-05-17T03:51:36","slug":"%e6%96%b0%e7%89%88%e6%9c%ac-dart-sass-%e6%9b%bf%e6%8d%a2-node-sass","status":"publish","type":"post","link":"https:\/\/usei.cn\/index.php\/2022\/05\/17\/%e6%96%b0%e7%89%88%e6%9c%ac-dart-sass-%e6%9b%bf%e6%8d%a2-node-sass\/","title":{"rendered":"\u65b0\u7248\u672c dart-sass \u66ff\u6362 node-sass"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u5982\u679c\u5b89\u88c5\u4e86node-sass\u9996\u5148\u9700\u8981\u5378\u8f7d<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>npm uninstall node-sass<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5dart-sass<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install sass sass-loader -D<\/code><\/pre>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u5982\u679c\u9879\u76ee\u4e4b\u524d\u7528\u5230\/deep\/\u9700\u8981\u66ff\u6362\u4e3a::v-deep\uff0c\u5426\u5219\u4f1a\u62a5\u9519\uff0c\u5168\u5c40\u641c\u7d22 \/deep\/ , \u5c06\u9879\u76ee\u91cc\u7684 \/deep\/ \u66ff\u6362\u4e3a ::v-deep<\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u9009\u62e9dart-sass\u7684\u7406\u7531<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>Sass \u662f\u4e00\u79cd CSS \u7684\u9884\u7f16\u8bd1\u8bed\u8a00\u3002\u5b83\u63d0\u4f9b\u4e86 \u53d8\u91cf\uff08variables\uff09\u3001\u5d4c\u5957\uff08nested rules\uff09\u3001 \u6df7\u5408\uff08mixins\uff09\u3001<br>\u51fd\u6570\uff08functions\uff09\u7b49\u529f\u80fd\uff0c\u5e76\u4e14\u5b8c\u5168\u517c\u5bb9 CSS \u8bed\u6cd5\u3002Sass \u80fd\u591f\u5e2e\u52a9\u590d\u6742\u7684\u6837\u5f0f\u8868\u66f4\u6709\u6761\u7406\uff0c \u5e76\u4e14\u6613\u4e8e<br>\u5728\u9879\u76ee\u5185\u90e8\u6216\u8de8\u9879\u76ee\u5171\u4eab\u8bbe\u8ba1\u3002<\/li><li>\u5728 v4.3.0\u4e4b\u524d\u672c\u9879\u76ee\u90fd\u662f\u57fa\u4e8enode-sass\u8fdb\u884c\u6784\u5efa\u7684\uff0c\u4f46node-sass\u5e95\u5c42\u4f9d\u8d56 libsass\uff0c\u5bfc\u81f4\u5f88\u591a\u7528\u6237\u5b89\u88c5<br>\u7684\u7279\u522b\u7684\u56f0\u96be\uff0c\u5c24\u5176\u662f windows\u7528\u6237\uff0c\u5b83\u5f3a\u5236\u7528\u6237\u5728windows\u73af\u5883\u4e2d\u5fc5\u987b\u5b89\u88c5python2\u548cVisual Studio\u624d<br>\u80fd\u7f16\u8bd1\u6210\u529f\u3002 \u6240\u4ee5\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u672c\u9879\u76ee\u5728v4.3.0\u4fee\u6539\u4e3adart-sass\u8fdb\u884c\u6784\u5efa\uff0c\u5b83\u80fd\u5728\u4fdd\u8bc1\u6027\u80fd\u7684\u524d<br>\u63d0\u4e0b\u5927\u5927\u7b80\u5316\u7528\u6237\u7684\u5b89\u88c5\u6210\u672c\u3002\u901a\u8fc7\u8fd9\u4e2aissue\u4e0b\u9762\u76f8\u5173\u7684\u8bc4\u8bba\u5c31\u53ef\u4ee5\u77e5\u9053\uff0c\u5b89\u88c5 node-sass \u662f\u591a\u4e48\u9ebb\u70e6 \u7684<br>\u4e00\u4ef6\u4e8b\u3002<\/li><li>\u8fd9\u91cc\u9009\u62e9\u4f7f\u7528dart-sass\u8fd8\u6709\u4e00\u4e2a\u66f4\u4e3b\u8981\u7684\u539f\u56e0\uff0csass\u5b98\u65b9\u5df2\u7ecf\u5c06dart-sass\u4f5c\u4e3a\u672a\u6765\u4e3b\u8981\u7684\u7684\u5f00\u53d1\u65b9\u5411\u4e86<br>\uff0c\u6709\u4efb\u4f55\u65b0\u529f\u80fd\u5b83\u90fd\u662f\u4f1a\u4f18\u5148\u652f\u6301\u7684\uff0c\u800c\u4e14\u5b83\u5df2\u7ecf\u5728\u793e\u533a\u91cc\u7a33\u5b9a\u8fd0\u884c\u4e86\u5f88\u957f\u7684\u4e00\u6bb5\u65f6\u95f4\uff0c\u57fa\u672c\u6ca1\u6709\u4ec0\u4e48<br>\u5751\u4e86\u3002dart-sass\u4e4b\u6240\u4ee5\u5bb9\u6613\u5b89\u88c5\uff0c\u4e3b\u8981\u662f\u56e0\u4e3a\u5b83\u4f1a\u88ab\u7f16\u8bd1\u6210\u7eaf js\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u76f4\u63a5\u5728\u7684 node \u73af\u5883\u4e2d\u4f7f\u7528<br>\u3002\u867d\u7136\u8fd9\u6837\u5b83\u7684\u8fd0\u884c\u901f\u5ea6\u4f1a\u6bd4\u57fa\u4e8e libsass\u7684\u6162\u4e00\u4e9b\u4e9b\uff0c\u4f46\u8fd9\u4e9b\u901f\u5ea6\u7684\u5dee\u5f02\u51e0\u4e4e\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u3002\u6574\u4e2a\u793e\u533a<br>\u73b0\u5728\u90fd\u5728\u62e5\u62b1dart-sass\uff0c\u6211\u4eec\u6ca1\u6709\u7406\u7531\u62d2\u7edd\uff01\u800c\u4e14\u5b83\u7684\u786e\u5927\u5927\u7b80\u5316\u4e86\u7528\u6237\u7684\u5b89\u88c5\u6210\u672c\u3002<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0d\u9009\u62e9node-sass\u7684\u7406\u7531<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>node-sass\u5728npm\u5b89\u88c5\u7684\u65f6\u5019\u5927\u6982\u7387\u7684\u4f1a\u5b89\u88c5\u51fa\u9519\uff0c\u6216\u4e0b\u8f7d\u65f6\u95f4\u8fc7\u957f\uff0c\u56e0\u6b64\u8003\u8651\u7528dart-sass\u6765\u66ff\u6362<\/li><li>node-sass\u5df2\u7ecf\u505c\u6b62\u66f4\u65b0<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">node-sass \u4e0e dart-sass \u533a\u522b<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>node-sass \u662f\u7528 node(\u8c03\u7528 cpp \u7f16\u5199\u7684 libsass)\u6765\u7f16\u8bd1 sass\uff1b<\/li><li>dart-sass \u662f\u7528 drat VM \u6765\u7f16\u8bd1 sass\uff1b<\/li><li>node-sass\u662f\u81ea\u52a8\u7f16\u8bd1\u5b9e\u65f6\u7684\uff0cdart-sass\u9700\u8981\u4fdd\u5b58\u540e\u624d\u4f1a\u751f\u6548<\/li><li>\u63a8\u8350 dart-sass \u6027\u80fd\u66f4\u597d\uff08\u4e5f\u662f sass \u5b98\u65b9\u4f7f\u7528\u7684\uff09\uff0c\u800c\u4e14 node-sass \u56e0\u4e3a\u56fd\u60c5\u95ee\u9898\u7ecf\u5e38\u88c5\u4e0d\u4e0a<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u5b89\u88c5\u4e86node-sass\u9996\u5148\u9700\u8981\u5378\u8f7d \u5b89\u88c5dart-sass \u5982\u679c\u9879\u76ee\u4e4b\u524d\u7528\u5230\/deep\/\u9700\u8981\u66ff\u6362\u4e3a::v [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-453","post","type-post","status-publish","format-standard","hentry","category-frontend"],"_links":{"self":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts\/453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/comments?post=453"}],"version-history":[{"count":1,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts\/453\/revisions"}],"predecessor-version":[{"id":454,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/posts\/453\/revisions\/454"}],"wp:attachment":[{"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/media?parent=453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/categories?post=453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/usei.cn\/index.php\/wp-json\/wp\/v2\/tags?post=453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}