Skip to content

[Bug]: Test files are included in the build output #786

@Karibash

Description

@Karibash

Version

System:
    OS: macOS 15.3
    CPU: (11) arm64 Apple M3 Pro
    Memory: 98.45 MB / 36.00 GB
    Shell: 3.7.1 - /opt/homebrew/bin/fish
  Browsers:
    Chrome: 133.0.6943.127
    Safari: 18.3
  npmPackages:
    @rslib/core: 0.5.1 => 0.5.1

Details

Currently, test files (e.g., *.test.ts and *.test.tsx) are included in the build output. These files are typically not needed in production and should be excluded by default.

Expected Behavior

Test files should be excluded from the build output unless explicitly included.

Proposed Solution

Exclude *.test.ts and *.test.tsx files from the build by default. This would help prevent unnecessary files from being bundled and deployed.

Would it be possible to add this exclusion as a default behavior?
Let me know your thoughts!

Reproduce link

https://codesandbox.io/p/devbox/great-elbakyan-njflsf

Reproduce Steps

  1. Run the build process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions