Skip to content

[Feature]: distPath should support dist/[name] style template in multiple entries mode. #4889

@LyunKi

Description

@LyunKi

What problem does this feature solve?

currently, I found that I had to use js API to impl this feat like below:

import { createRsbuild, mergeRsbuildConfig } from '@rsbuild/core';
import config from '../rsbuild.config.mjs';
import {  plugins } from "../plugins.mjs";

await Promise.all(plugins.map(async (plugin) => {
  const entry = {
    index: `src/${plugin}`,
  };
  config.source.entry = entry;
  const buildConfig = mergeRsbuildConfig(config, {
    output: {
      distPath: {
        root: `dist/${plugin}`
      }
    }
  });
  const rsbuild = await createRsbuild({ rsbuildConfig: buildConfig });
  await rsbuild.build();
}));

It would be much easier to use if the distPath.root support 'dist/${entry}'.

What does the proposed API look like?

    output: {
      distPath: {
        root: `dist/[entry]`
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions