Skip to content

[Bug]: Error occurred when packaging UMD files './src/**?__rslib_entry__ not found #632

@yoke0104x

Description

@yoke0104x

Version

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M1 Pro
    Memory: 172.78 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.2
  npmPackages:
    @rslib/core: ^0.2.2 => 0.2.2

Details

Image

Package as a component src/index as the main entry component
If you set the index to ./src/index.tsx, there will be no error (there is no content in ESM, CJS)
If you set the index to ./src/**, there will be a problem with the above screenshots

import { pluginReact } from '@rsbuild/plugin-react';
import { defineConfig } from '@rslib/core';

export default defineConfig({
  source: {
    entry: {
      index: ['./src/**'],
    },
  },
  lib: [
    {
      bundle: false,
      dts: true,
      format: 'esm',
      output: {
        distPath: {
          root: './dist/esm',
        },
        minify: true,
      },
    },
    {
      bundle: false,
      dts: true,
      format: 'cjs',
      output: {
        distPath: {
          root: './dist/cjs',
        },
        minify: true,
      },
    },
    {
      format: 'umd',
      umdName: 'rsCom',
      output: {
        externals: {
          react: 'rsCom',
        },
        distPath: {
          root: './dist/umd',
        },
      },
    },
  ],
  output: {
    target: 'web',
  },
  plugins: [pluginReact()],
});

Reproduce link

https://github.com/yoke0104x/temp.git

Reproduce Steps

simple steps

  1. cd rs_com
  2. pnpm i
  3. pnpm build
  4. you can see the error message

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