iOS / Server / Web developer
Currently: I'm a frontend dev and product maker working for myself and freelance clients from my office in London. Previously I could be found: flying around the globe in 80 days, working 7 years at Foursquare, including managing their apps teams, and scraping together a classic New York life as an actor/bartender.
Markdown supported · ⌘↵ to post
Tailwind do trim unwanted css with new JIT mode Without using purgeCss unlike bootstrap. And every website looks almost same in Bootstrap, while in tailwind you have got complete control over the design. Without using any external libs
Dietrich Wallmann
Hi, thanks for your article on how to include sass and bootstrap into a next.js project. As for the caveat, you can evaluate the process.env.NODE_ENV variable and add the purgecss setting block only in the production environment. For more, see the next.js docs: Customizing Plugins . Here is my postcss.config.js file:
module.exports = { plugins: [ 'postcss-flexbugs-fixes', [ 'postcss-preset-env', { autoprefixer: {flexbox: 'no-2009'}, stage: 3, features: {'custom-properties': false}, }, ], ], }; if (process.env.NODE_ENV === 'production') { module.exports.plugins.push([ '@fullhuman/postcss-purgecss', { content: ['./src/**/*.{js,jsx,ts,tsx}', './pages/**/*.{js,jsx,ts,tsx}'], defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [], safelist: ['html', 'body'], }, ]); }In my still empty project that includes bootstrap, I could decrease the size of the .next folder from 6.6 MB to 5.2MB using purgecss in the production build.