Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up builds by excluding node_modules from tailwind config #1236

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

bookernath
Copy link
Contributor

@bookernath bookernath commented Aug 7, 2024

What/Why?

vercel/next.js#37825 (comment)

Our build time was spending over 60 seconds on Creating an optimized production build... so I tried removing the node_modules folder from the content in tailwind config, and I see much faster build times now.

Testing

Preview build

Before:
image
image

After:
image

image

@bookernath bookernath requested a review from a team as a code owner August 7, 2024 02:09
Copy link

changeset-bot bot commented Aug 7, 2024

🦋 Changeset detected

Latest commit: ed371e0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Aug 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-latest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 2:14am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
catalyst ⬜️ Ignored (Inspect) Aug 7, 2024 2:14am
catalyst-1millionproducts-store ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 2:14am
catalyst-au ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 2:14am
catalyst-test-store ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 2:14am
catalyst-uk ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 2:14am
catalyst-unstable ⬜️ Ignored (Inspect) Visit Preview Aug 7, 2024 2:14am

Copy link
Contributor

github-actions bot commented Aug 7, 2024

⚡️🏠 Lighthouse report

Lighthouse ran against https://catalyst-latest-q16lo7wbf-bigcommerce-platform.vercel.app

🖥️ Desktop

We ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:

Category Score
🟠 Performance 85
🟢 Accessibility 100
🟢 Best practices 96
🟠 SEO 82

📱 Mobile

We ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:

Category Score
🟢 Performance 92
🟢 Accessibility 100
🟢 Best practices 96
🟠 SEO 85

content: [
'./app/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',
'!./node_modules/**', // Exclude everything in node_modules to speed up builds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, do you know why this happens? I don't understand why we have to exclude a path we aren't including. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I knew!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it's expected: tailwindlabs/tailwindcss#5014 (comment)

@bookernath bookernath added this pull request to the merge queue Aug 7, 2024
Merged via the queue into main with commit 7d9e865 Aug 7, 2024
12 of 13 checks passed
@bookernath bookernath deleted the tailwind-build branch August 7, 2024 02:34
This was referenced Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants