\u7f51\u9875\u7aef\u9576\u5d4cexe<\/a>throw err;<\/p>\n fs.writeFileSync(‘style.css’, result.css);<\/p>\n
});<\/p>\n
“`<\/p>\n
\u8fd9\u4e2aNode.js\u811a\u672c\u4f7f\u7528node-sass\u5c06style.scss\u6587\u4ef6\u8f6c\u6362\u4e3astyle.css\u6587\u4ef6\uff0c\u5e76\u5c06\u8f93\u51fa\u6837\u5f0f\u8bbe\u7f6e\u4e3a\u538b\u7f29\u683c\u5f0f\u3002<\/p>\n
6. \u6253\u5305\u4e3aexe\u6587\u4ef6<\/p>\n
\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5c06Node.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff1a<\/p>\n
“`<\/p>\n
pkg build.js –output style<\/p>\n
“`<\/p>\n
\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5c06build.js\u6587\u4ef6\u6253\u5305\u4e3a\u540d\u4e3astyle\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n
7. \u8fd0\u884cexe\u6587\u4ef6<\/p>\n
\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u8fd0\u884cstyle.exe\u6587\u4ef6\uff1a<\/p>\n
“`<\/p>\n
.\/style<\/p>\n
“`<\/p>\n
\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u6267\u884cstyle.exe\u6587\u4ef6\uff0c\u5e76\u5c06style.scss\u6587\u4ef6\u8f6c\u6362\u4e3astyle.css\u6587\u4ef6\u3002<\/p>\n
\u603b\u7ed3<\/p>\n
\u4ee5\u4e0a\u5c31\u662f\u5c06Sass\u4ee3\u7801\u6253\u5305\u4e3aexe\u6587\u4ef6\u7684\u8be6\u7ec6\u4ecb\u7ecd\u3002\u901a\u8fc7\u4f7f\u7528Node.js\u548cpkg\u5de5\u5177\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06Sass\u4ee3\u7801\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u5728\u6ca1\u6709\u5b89\u88c5Sass\u7684\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u8ba9\u6211\u4eec\u66f4\u52a0\u65b9\u4fbf\u5730\u5206\u4eab\u548c\u53d1\u5e03Sass\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Sass\u662f\u4e00\u79cdCSS\u9884\u5904\u7406\u5668\uff0c\u5b83\u53ef\u4ee5\u8ba9\u5f00\u53d1\u8005\u66f4\u52a0\u9ad8\u6548\u5730\u7f16\u5199CSS\u4ee3\u7801\u3002Sass\u7684\u5de5\u4f5c\u539f\u7406\u662f\u5c06Sass\u4ee3\u7801\u8f6c\u6362\u4e3aCSS\u4ee3\u7801\uff0c\u4ece\u800c\u4f7f\u6d4f\u89c8\u5668\u80fd\u591f\u6b63\u5e38\u89e3\u6790\u548c\u6e32\u67d3\u9875\u9762\u3002\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u9700\u8981\u5c06Sass\u4ee3\u7801<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[16706,38,9154,12,52],"topic":[],"class_list":["post-10934","post","type-post","status-publish","format-standard","hentry","category-zhuomianruanjian","tag-jettyexe","tag-38","tag-vueexe","tag-12","tag-52"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/10934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=10934"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/10934\/revisions"}],"predecessor-version":[{"id":11041,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/10934\/revisions\/11041"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=10934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=10934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=10934"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=10934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}