Skip to content

[Bug]: Packages created with create-rslib fail to build in Webpack 4 projects #1128

@Colin3191

Description

@Colin3191

Version

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12600KF
    Memory: 18.99 GB / 31.83 GB
  Browsers:
    Edge: Chromium (130.0.2849.46)
    Internet Explorer: 11.0.26100.1882

Details

When using an npm package generated by create-rslib in a Webpack 4 project, the build fails with module resolution errors. This occurs because:

  1. The generated package.json only contains the exports field
  2. Webpack 4 has limited support for the exports field resolution
  3. Missing fallback main/module fields that Webpack 4 expects

Reproduce link

N/A

Reproduce Steps

  1. Create a package using create-rslib
  2. Use it in a Webpack 4 project
  3. Run build command
  4. Observe module resolution failure

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