﻿{"id":53632,"date":"2023-01-22T05:58:47","date_gmt":"2023-01-22T05:58:47","guid":{"rendered":"https:\/\/www.bookwormhead.com\/?p=53632"},"modified":"2023-01-22T05:58:47","modified_gmt":"2023-01-22T05:58:47","slug":"tailwind-scss-webpack","status":"publish","type":"post","link":"https:\/\/bookwormhead.com\/cms\/tailwind-scss-webpack\/","title":{"rendered":"Guide To Install Tailwind Scss For Webpack 5.0  | TailwindSCSS"},"content":{"rendered":"<h3>1. Tailwind And Dependencies<\/h3>\n<p>Run the following in the terminal to install the tailwind, post-css loader, sass-loader, mini css extractor and generate a tailwind.config.js<\/p>\n<p><script src=\"https:\/\/gist.github.com\/anj-bookwormhead\/5b43c77ace04e1da89fb09dd936c8f22.js\"><\/script><\/p>\n<h3>2. Editing The Tailwind Config<\/h3>\n<p>Add the default declaration in your tailwind.config by pasting the code. Make sure you purge the correct directory where your html sit,\u00a0 Example: my index.html sits in dist\/index.html. You can add more in your purge if you have more than file e<a href=\"https:\/\/www.gluelesswigsshop.com\/best-wigs\/\"><strong>best wigs<\/strong><\/a> <a href=\"https:\/\/www.onlinejerseyscustom.com\/\"><strong>castelli tutto nano jersey<\/strong><\/a> <a href=\"https:\/\/freewaybambootattoo.com\/\"><strong>custom youth nfl jersey<\/strong><\/a> <a href=\"https:\/\/www.customjerseysbest.com\/custom-baseball-jerseys\/\"><strong>custom baseball jerseys<\/strong><\/a> <a href=\"https:\/\/fansidea.org\/\"><strong>custom hockey jerseys<\/strong><\/a> <a href=\"https:\/\/www.wigshumanhairshop.com\/\"><strong>belletress caliente<\/strong><\/a> <a href=\"http:\/\/www.jordannikeairstore.com\/\"><strong>air jordan 1 low flyease<\/strong><\/a> <a href=\"https:\/\/pennstateproshops.com\/penn-state-football-jersey\/\"><strong>saquon barkley jersey<\/strong><\/a> <a href=\"https:\/\/www.mensnikeairmaxoutlet.com\/nike-air-max-270-sale-2\/\"><strong>nike air max 270 women&#8217;s sale<\/strong><\/a> <a href=\"https:\/\/www.customjerseyssports.com\/\"><strong>castelli vantaggio jersey<\/strong><\/a> <a href=\"https:\/\/www.adidasyeezyoutletonline.com\/\"><strong>adidas yeezy boost 350 v2 mono ice<\/strong><\/a> <a href=\"https:\/\/www.nikeairmax270sale.com\/\"><strong>jordan proto max 720<\/strong><\/a> <a href=\"https:\/\/fansidea.org\/\"><strong>custom nfl football jerseys<\/strong><\/a> <a href=\"https:\/\/www.customjerseybest.com\/\"><strong>personalized celtics jersey<\/strong><\/a> <a href=\"https:\/\/www.lesbiantoysstore.com\/\"><strong>corinne abbigliamento sexy<\/strong><\/a> .g .js, css, you can disable the purge after by sitting it to false.<br \/>\n<script src=\"https:\/\/gist.github.com\/anj-bookwormhead\/8e983b736335595a041e59981796402b.js\"><\/script><\/p>\n<h3>3. Create A postcss.config.js In Your Root Directory<\/h3>\n<p><script src=\"https:\/\/gist.github.com\/anj-bookwormhead\/e5122a57828ae2c77ec089bf01f27872.js\"><\/script><\/p>\n<h3>4. Declaration To Add On Wepack.config.js<\/h3>\n<p>I assume that you already install the dependencies in step 1. Now, let&#8217;s start declaring the following:<\/p>\n<ol>\n<li>We need to <em>require<\/em> the css extractor to create a copy of css file in your <em>dist<\/em> folder <span style=\"color: #000080;\">[see line 1] <\/span>. Also, add the css extrator to your rules <span style=\"color: #000080;\">[see line 18-22 ].<\/span> Lastly,\u00a0 declare the <em>path<\/em> under the plugins to instruct webpack where the system generate the css file <span style=\"color: #000080;\">[59-60].<\/span><\/li>\n<li><span style=\"color: #ff0000;\">IMPORTANT:<\/span> Add the required post-css loader and the path of postcss.config to run the tailwind<span style=\"color: #000080;\">[27-31].<\/span><\/li>\n<li>Tailwind doesn&#8217;t really recommend to use SCSS so if you want it for personal preference, you need to declare the SCSS as your loader. Note: scss-loader minimize your css files by default but you can adjust the outputStyles if you wanted to be expanded.<\/li>\n<\/ol>\n<p><script src=\"https:\/\/gist.github.com\/anj-bookwormhead\/f41de56ff1bd079ea88da0107a905d04.js\"><\/script><\/p>\n<p>Note! I am assuming that you already installed webpack. If you don&#8217;t, check their documentation <a href=\"https:\/\/webpack.js.org\/guides\/installation\/\">here<\/a> or I suggest to watch the crash course <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.youtube.com\/watch?v=MpGLUVbqoYQ\">Cole created for Webpack powered by FreeCodeCamp<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Tailwind And Dependencies Run the following in the terminal to install the tailwind, post-css loader, sass-loader, mini css extractor and generate a tailwind.config.js 2. Editing The Tailwind Config Add the default declaration in your tailwind.config by pasting the code. Make sure you purge the correct directory where your html sit,\u00a0 Example: my index.html sits [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,161],"tags":[168,164,163,162],"class_list":["post-53632","post","type-post","status-publish","format-standard","hentry","category-design","category-front-end","tag-css","tag-scss","tag-tailwind","tag-webpack"],"_links":{"self":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/posts\/53632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/comments?post=53632"}],"version-history":[{"count":0,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/posts\/53632\/revisions"}],"wp:attachment":[{"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/media?parent=53632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/categories?post=53632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bookwormhead.com\/cms\/wp-json\/wp\/v2\/tags?post=53632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}