Skip to content

[Feature]: provide better comment annotation  #7591

@hardfist

Description

@hardfist

What problem does this feature solve?

currently rspack | webpack will generate the following result for modern-module, the comment is not nicely(Concate module seems hard to understand for normal users) to read, even minifier can remove these comments, but normally library code shouldn't be minified for better debug experience

;// CONCATENATED MODULE: ./src/answer.js
const answer = 42;

;// CONCATENATED MODULE: ./src/secret.js
const secret = 'rspack';

;// CONCATENATED MODULE: ./src/index.js



export { answer, secret };

//# sourceMappingURL=index.mjs.map

What does the proposed API of configuration look like?

there're some solutions, i'm not sure which is better

  • provide a option to remove comments (like rollup don't have this annotation)
{
  output: {
      keepDebugComments: boolean // true means keep, false means remove
   }
}
  • provide better comment annotation(like esbuild provide the simplest annotation)
 ./src/answer.js
const answer = 42;

 ./src/secret.js
const secret = 'rspack';

 ./src/index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or requeststaleteamThe issue/pr is created by the member of Rspack.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions