This template is made to help start your project based on Webpack + TailwindCSS without too much complication while keeping best performance practices set up, so you dont have to worry about basics.
Local development is aided by livereload.
- To use this template, click "Use this template" green button in the top right.
- Clone the repository to your computer
- Install dependencies -
npm ci
- Configure where your views are in tailwind.config.js.
npm start
- runslive-server
onhttp://localhost:8080
and reloads the browser on changesnpm run build
- build assets in production mode
- JS and CSS transpilation and minification done by ESBuild (FAST)
- CSS extraction using
mini-css-extract-plugin
- Example: Prefetched chunk, if you want to load faster critical parts of your build
- Example: Asynchronously loaded chunks, to block page rendering when loading/parsing/executing
- Example: Named chunks if you dont want your chunks to look like
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed.js
- autoprefixer - Adding vendor prefixes, just in case. See package.json for
browserslist
config - postcss-import - Support for @imports - just like in SASS
- postcss-fixes - Various fixes improving your CSS cross-browser compatibility
- Official TailwindCSS Custom Forms plugin loaded
- How to extend color palette
- How to prefix your colors to not collide with default theme
- How to set a different font as first in font family declaration
xxl
breakpoint for responsive purposes
- Images, fonts, etc. are not handled by webpack. I put them into the dist directory in
fonts/
,img/
. - Before you build using
npm run build
task, everything inapp/assets/js
andapp/assets/css
is removed, to start with a clean slate and never deploy out-of-date assets
- Tailwind.run - sandbox for quickly mocking/debugging components in isolation
- TailwindCSS Cheat Sheet - with search. Hopefully will be updated to the latest TailwindCSS version soon
- VSCode IntelliSense - Custom config aware autocomplete for TailwindCSS
- Webpack dynamic imports - How and why do the dynamic imports. See
js/app.js
for example.
- Use TailwindCSS CLI to generate CSS (simpler Webpack config, less npm packages, better performance)
- Simplify PostCSS config (TailwindCSS will include autoprefixer and minification)