{"id":2225,"date":"2024-11-10T15:39:09","date_gmt":"2024-11-10T07:39:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2225\/"},"modified":"2024-11-10T15:39:09","modified_gmt":"2024-11-10T07:39:09","slug":"react-%e6%88%96-vite-%e6%98%af%e5%90%a6%e4%bc%9a%e8%87%aa%e5%8a%a8%e5%8a%a0%e8%bd%bd-css%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2225\/","title":{"rendered":"React \u6216 Vite \u662f\u5426\u4f1a\u81ea\u52a8\u52a0\u8f7d CSS\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173069428921162.jpg\" class=\"aligncenter\" title=\"React \u6216 Vite \u662f\u5426\u4f1a\u81ea\u52a8\u52a0\u8f7d CSS\uff1f\u63d2\u56fe\" alt=\"React \u6216 Vite \u662f\u5426\u4f1a\u81ea\u52a8\u52a0\u8f7d CSS\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>React \u6216 Vite \u662f\u5426\u81ea\u52a8\u52a0\u8f7d CSS\uff1f<\/strong><\/p>\n<p>\u5728 React \u4e2d\uff0c\u5982\u679c\u672a\u663e\u5f0f\u5bfc\u5165 CSS\uff0c\u800c\u9875\u9762\u5374\u51fa\u73b0\u4e86 CSS \u6548\u679c\uff0c\u8fd9\u53ef\u80fd\u662f\u4ee5\u4e0b\u539f\u56e0\u9020\u6210\u7684\uff1a<\/p>\n<p>\u4f60\u4f7f\u7528\u7684\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5e93\uff0c\u4f8b\u5982 AntD\uff0c\u5305\u542b\u4e86\u81ea\u5df1\u7684 CSS \u6837\u5f0f\u3002\u8fd9\u4e9b\u7ec4\u4ef6\u5e93\u5728\u4f7f\u7528\u65f6\u4f1a\u81ea\u52a8\u52a0\u8f7d\u5176 CSS \u6837\u5f0f\uff0c\u65e0\u9700\u663e\u5f0f\u5bfc\u5165\u3002\u5728\u4f60\u7684\u4ee3\u7801\u793a\u4f8b\u4e2d\uff0cclass \u7684\u6837\u5f0f\u53ef\u80fd\u662f\u7531 AntD \u7ec4\u4ef6\u63d0\u4f9b\u7684\u3002<\/p>\n<p>\u8981\u7981\u6b62\u81ea\u52a8\u52a0\u8f7d CSS\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>\n<p><strong>\u5bf9\u4e8e React \u9879\u76ee\uff1a<\/strong><\/p>\n<ul>\n<li>\u5728 webpack \u914d\u7f6e\u4e2d\u8bbe\u7f6e ignoreOrder \u9009\u9879\u4e3a true\u3002<\/li>\n<li>\u4f7f\u7528 CSS \u9884\uff0c\u4f8b\u5982 Less \u6216 Sass\uff0c\u5e76\u663e\u5f0f\u5bfc\u5165\u6240\u9700\u7684 CSS \u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5bf9\u4e8e Vite \u9879\u76ee\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 CSS \u9884\u5904\u7406\u5668\uff0c\u5e76\u663e\u5f0f\u5bfc\u5165\u6240\u9700\u7684 CSS \u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662fReact \u6216 Vite \u662f\u5426\u4f1a\u81ea\u52a8\u52a0\u8f7d CSS\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>React \u6216 Vite \u662f\u5426\u81ea\u52a8\u52a0\u8f7d CSS\uff1f \u5728 React \u4e2d\uff0c\u5982\u679c\u672a\u663e\u5f0f\u5bfc\u5165 CSS\uff0c\u800c\u9875\u9762\u5374\u51fa\u73b0\u4e86 CSS \u6548\u679c\uff0c\u8fd9\u53ef\u80fd\u662f\u4ee5\u4e0b\u539f\u56e0\u9020\u6210\u7684\uff1a \u4f60\u4f7f\u7528\u7684\u7b2c\u4e09\u65b9\u7ec4\u4ef6\u5e93\uff0c\u4f8b\u5982 AntD\uff0c\u5305\u542b\u4e86\u81ea\u5df1\u7684 CSS \u6837\u5f0f\u3002\u8fd9\u4e9b\u7ec4\u4ef6\u5e93\u5728\u4f7f\u7528\u65f6\u4f1a\u81ea\u52a8\u52a0\u8f7d\u5176 CSS \u6837\u5f0f\uff0c\u65e0\u9700\u663e\u5f0f\u5bfc\u5165\u3002\u5728\u4f60\u7684\u4ee3\u7801\u793a\u4f8b\u4e2d\uff0cclass \u7684\u6837\u5f0f\u53ef\u80fd\u662f\u7531 AntD \u7ec4\u4ef6\u63d0\u4f9b\u7684\u3002 \u8981\u7981\u6b62\u81ea\u52a8\u52a0\u8f7d CSS\uff0c\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5bf9\u4e8e React \u9879\u76ee\uff1a \u5728 webpack \u914d\u7f6e\u4e2d\u8bbe\u7f6e ignoreOrder \u9009\u9879\u4e3a true\u3002 \u4f7f\u7528 CSS \u9884\uff0c\u4f8b\u5982 Less \u6216 Sass\uff0c\u5e76\u663e\u5f0f\u5bfc\u5165\u6240\u9700\u7684 CSS \u6587\u4ef6\u3002 \u5bf9\u4e8e Vite \u9879\u76ee\uff1a \u4f7f\u7528 CSS \u9884\u5904\u7406\u5668\uff0c\u5e76\u663e\u5f0f\u5bfc\u5165\u6240\u9700\u7684 CSS \u6587\u4ef6\u3002 \u4ee5\u4e0a\u5c31\u662fReact \u6216 Vite \u662f\u5426\u4f1a\u81ea\u52a8\u52a0\u8f7d CSS\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2225","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=2225"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2225\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}