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

Include RSD package path in include option by default #1

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

javascripter
Copy link
Owner

@javascripter javascripter commented Nov 14, 2024

Why

ref. facebook/react-strict-dom#236 (comment)

At the moment, users manually have to add react-strict-dom source files in their config.

include: [
  'node_modules/react-strict-dom/dist/**/*.{js,jsx,ts,tsx}',
]

This is cumbersome and can be especially error-prone in a monorepo because packages may get hoisted to a root depending on how project is configured.

This PR pre-configures include option by adding the appropriate glob paths by default so that users do not need to add it to their config.

How

By using require.resolve('react-strict-dom/package.json') to determine the installed path of react-strict-dom.

Users will still need to provide their application source code paths in their include option, so the default include and exclude paths are now always added to the config.

Test Plan

  • Update README
  • Test locall against an Expo Web project

src/index.ts Show resolved Hide resolved
return [
// Exclude TypeScript declaration files by default
// because it never contains any CSS rules.
'**/*.d.ts',
Copy link

Choose a reason for hiding this comment

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

Flow too

@javascripter javascripter deleted the default-options branch November 15, 2024 08:51
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.

2 participants