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

fix: exclude .scss files from extract-experimental build #1935

Merged
merged 1 commit into from
May 14, 2024

Conversation

panbenson
Copy link
Contributor

Description

Prevents esbuild from erroring on .scss files during lingui extract-experimental. Although this can be solved locally with experimental.extractor.excludeExtensions, I figured the .scss extension is common enough that this PR may help someone else further on.

Below is the error I got when running the build:

✘ [ERROR] No loader is configured for ".scss" files: someStyle.scss

    someJSFile.js:7:19:
      7 │ import styles from './someStyle.scss';
        ╵                    ~~~~~~~~~~~~~~~~~~~~

When I add .scss to the excluded extensions, message extraction proceeds as expected.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Copy link

vercel bot commented May 13, 2024

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

Name Status Preview Comments Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 8:50pm

@panbenson panbenson changed the title exclude .scss files from extract-experimental build fix: exclude .scss files from extract-experimental build May 13, 2024
Copy link

size-limit report 📦

Path Size
./packages/core/dist/index.mjs 2.87 KB (0%)
./packages/detect-locale/dist/index.mjs 723 B (0%)
./packages/react/dist/index.mjs 1.67 KB (0%)
./packages/remote-loader/dist/index.mjs 7.26 KB (0%)

Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.01%. Comparing base (d6b9698) to head (69ed405).
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1935      +/-   ##
==========================================
- Coverage   76.65%   76.01%   -0.64%     
==========================================
  Files          81       85       +4     
  Lines        2090     2110      +20     
  Branches      533      539       +6     
==========================================
+ Hits         1602     1604       +2     
- Misses        375      393      +18     
  Partials      113      113              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@thekip thekip left a comment

Choose a reason for hiding this comment

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

While this change is very useful, i'm thinking why I didn't implement it originally in the opposite way to include only some extensions... This should make extractor more robust

@andrii-bodnar andrii-bodnar merged commit d01fa96 into lingui:main May 14, 2024
16 of 17 checks passed
@panbenson panbenson deleted the exclude-scss-from-build branch May 14, 2024 13:36
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.

None yet

3 participants