Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable module trace by default #4008

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/cases/config/stats-module-trace/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { build, proxyConsole } from '@e2e/helper';
import { expect, test } from '@playwright/test';

test('should log error module trace when enable moduleTrace', async () => {
test('should log error module trace', async () => {
const { restore, logs } = proxyConsole();

await expect(
Expand Down
14 changes: 0 additions & 14 deletions e2e/cases/config/stats-module-trace/rsbuild.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/compat/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"typescript": "^5.6.3"
},
"peerDependencies": {
"@rsbuild/core": "^1.1.2"
"@rsbuild/core": "^1.1.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to bump this version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalize stats with getStatsOptions is supported in rsbuild 1.1.3.
#3987

},
"publishConfig": {
"access": "public",
Expand Down
7 changes: 3 additions & 4 deletions packages/compat/webpack/src/createCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ export async function createCompiler(options: InitConfigsOptions) {
const done = (stats: Rspack.Stats) => {
const statsOptions = helpers.getStatsOptions(compiler);
const statsJson = stats.toJson({
moduleTrace: true,
children: true,
...(typeof statsOptions === 'string'
? { preset: statsOptions }
: { preset: 'errors-warnings' }),
...(typeof statsOptions === 'object' ? statsOptions : {}),
preset: 'errors-warnings',
...statsOptions,
});

const { message, level } = helpers.formatStats(
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/provider/createCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export async function createCompiler(options: InitConfigsOptions): Promise<{
const statsOptions = getStatsOptions(compiler);
const statsJson = stats.toJson({
children: true,
moduleTrace: true,
// get the compilation time
timings: true,
preset: 'errors-warnings',
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/server/socketServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export class SocketServer {
errorDetails: false,
entrypoints: true,
children: true,
moduleTrace: true,
};

const statsOptions = getStatsOptions(curStats.compilation.compiler);
Expand Down
Loading