Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/atob-npm-2.1.2-bcb583261e-0624406cc0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/fsevents-patch-afc6995412-10.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ms-npm-2.0.0-9e1101a471-0e6a22b8b7.zip
Binary file not shown.
Binary file removed .yarn/cache/nan-npm-2.19.0-2f5da4a528-b97f680753.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/pify-npm-4.0.1-062756097b-8b97cbf9dc.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/prr-npm-1.0.1-608d442761-3bca2db047.zip
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/pump-npm-2.0.1-05afac7fc4-e9f26a17be.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ret-npm-0.1.15-0d3c19de76-07c9e7619b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ssri-npm-6.0.2-4b770f07fd-7f8062604b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/urix-npm-0.1.0-bd5e55a13a-ebf5df5491.zip
Binary file not shown.
Binary file removed .yarn/cache/url-npm-0.11.3-d3652df78a-a3a5ba64d8.zip
Binary file not shown.
Binary file removed .yarn/cache/use-npm-3.1.1-7ba643714c-08a130289f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/y18n-npm-4.0.0-55cd797cc5-c3fabe29b0.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ They are configured from `packages/tests/jest.config.ts` and offer some helpers

Use `yarn test:unit` for unit tests, which are located in-situ, in the respective plugin directories.
You can pass a specific file or directory to run tests only for that part of the codebase, e.g., `yarn test:unit packages/plugins/rum-plugin`.
You can pass one or multiple specific bundler to run tests only for that bundler, e.g., `yarn test:unit --bundlers=esbuild,webpack4,webpack5`.
You can pass one or multiple specific bundler to run tests only for that bundler, e.g., `yarn test:unit --bundlers=esbuild,webpack`.

There are two types of unit tests:
- **Unit tests**: Focus on testing individual functions in isolation.
Expand All @@ -94,7 +94,7 @@ They will also use `nock` for mocking HTTP requests, and `memfs` for mocking fil
They are configured from `packages/tests/playwright.config.ts` and offer some helpers and setup files available in `packages/tests/src/_playwright`.

Use `yarn test:e2e` for cross-bundler E2E testing. Test fixtures are organized by feature flow in `packages/tests/src/e2e`.
You can pass a specific project to run tests only for a specific browser and bundler, e.g., `yarn test:e2e --project "chrome | webpack5"`.
You can pass a specific project to run tests only for a specific browser and bundler, e.g., `yarn test:e2e --project "chrome | webpack"`.
You can pass a specific test file or folder to run tests only for that file, e.g., `yarn test:e2e packages/tests/src/e2e/rumBrowserSdk`.

## Code Standards
Expand Down
186 changes: 5 additions & 181 deletions LICENSES-3rdparty.csv

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ export const INJECTED_FILE = '__datadog-helper-file';
export const ALL_ENVS = ['development', 'production', 'test'] as const;
export const ALL_BUNDLERS = ['webpack', 'vite', 'esbuild', 'rollup', 'rspack', 'rolldown', 'farm'];
export const SUPPORTED_BUNDLERS = ['webpack', 'vite', 'esbuild', 'rollup', 'rspack'] as const;
export const FULL_NAME_BUNDLERS = [
'esbuild',
'rollup',
'rspack',
'vite',
'webpack4',
'webpack5',
] as const;
export const ENV_VAR_REQUESTED_BUNDLERS = 'PLAYWRIGHT_REQUESTED_BUNDLERS';

export const HOST_NAME = 'datadog-build-plugins';
16 changes: 7 additions & 9 deletions packages/core/src/helpers/bundlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright 2019-Present Datadog, Inc.

import { getAllEntryFiles, getEsbuildEntries, isXpack } from '@dd/core/helpers/bundlers';
import type { ResolvedEntry, BundlerFullName } from '@dd/core/types';
import type { BundlerName, ResolvedEntry } from '@dd/core/types';
import {
addFixtureFiles,
getContextMock,
Expand Down Expand Up @@ -227,15 +227,13 @@ describe('Core Helpers Bundlers', () => {

describe('isXpack', () => {
test.each([
['rspack' as BundlerFullName, true],
['webpack4' as BundlerFullName, true],
['webpack5' as BundlerFullName, true],
['webpack' as BundlerFullName, true],
['esbuild' as BundlerFullName, false],
['rollup' as BundlerFullName, false],
['vite' as BundlerFullName, false],
['rspack', true],
['webpack', true],
['esbuild', false],
['rollup', false],
['vite', false],
])('Should correctly identify xpack bundler "%s" as %s', (bundlerName, expected) => {
expect(isXpack(bundlerName)).toBe(expected);
expect(isXpack(bundlerName as BundlerName)).toBe(expected);
});
});
});
5 changes: 2 additions & 3 deletions packages/core/src/helpers/bundlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

import type { BundlerFullName, GlobalContext, Logger, ResolvedEntry } from '@dd/core/types';
import type { BundlerName, GlobalContext, Logger, ResolvedEntry } from '@dd/core/types';
import type { PluginBuild } from 'esbuild';
import { glob } from 'glob';

Expand Down Expand Up @@ -76,5 +76,4 @@ export const getEsbuildEntries = async (
};

// From a bundler's name, is it part of the "xpack" family?
export const isXpack = (bundlerName: BundlerFullName) =>
['rspack', 'webpack4', 'webpack5', 'webpack'].includes(bundlerName);
export const isXpack = (bundlerName: BundlerName) => ['rspack', 'webpack'].includes(bundlerName);
4 changes: 2 additions & 2 deletions packages/core/src/helpers/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ export const unserializeBuildReport = (report: SerializedBuildReport): BuildRepo
type CustomPlugins = ReturnType<GetCustomPlugins>;
export const debugFilesPlugins = (context: GlobalContext): CustomPlugins => {
const outputFilePath = () =>
path.resolve(context.bundler.outDir, `output.${context.bundler.fullName}.json`);
path.resolve(context.bundler.outDir, `output.${context.bundler.name}.json`);
const reportFilePath = () =>
path.resolve(context.bundler.outDir, `report.${context.bundler.fullName}.json`);
path.resolve(context.bundler.outDir, `report.${context.bundler.name}.json`);
const xpackPlugin: IterableElement<CustomPlugins>['webpack'] &
IterableElement<CustomPlugins>['rspack'] = (compiler) => {
type Stats = Parameters<Parameters<typeof compiler.hooks.done.tap>[1]>[0];
Expand Down
7 changes: 2 additions & 5 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type * as telemetry from '@dd/telemetry-plugin';
import type { BodyInit } from 'undici-types';
import type { UnpluginOptions } from 'unplugin';

import type { ALL_ENVS, FULL_NAME_BUNDLERS, SUPPORTED_BUNDLERS } from './constants';
import type { ALL_ENVS, SUPPORTED_BUNDLERS } from './constants';

export type Assign<A, B> = Omit<A, keyof B> & B;
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
Expand Down Expand Up @@ -57,7 +57,7 @@ export type SerializedInput = Assign<Input, { dependencies: string[]; dependents
export type SerializedOutput = Assign<Output, { inputs: string[] }>;

export type Log = {
bundler?: BundlerFullName;
bundler?: BundlerName;
pluginName: string;
type: LogLevel;
message: string;
Expand Down Expand Up @@ -103,7 +103,6 @@ export type SerializedBuildReport = Assign<
}
>;

export type BundlerFullName = (typeof FULL_NAME_BUNDLERS)[number];
export type BundlerName = (typeof SUPPORTED_BUNDLERS)[number];
export type BundlerReport = GlobalData['bundler'] & {
outDir: string;
Expand Down Expand Up @@ -277,8 +276,6 @@ export type FileValidity = {
export type GlobalData = {
bundler: {
name: BundlerName;
fullName: BundlerFullName;
variant: string; // e.g. Major version of the bundler (webpack 4, webpack 5)
version: string;
};
env: Env;
Expand Down
5 changes: 2 additions & 3 deletions packages/factory/src/helpers/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Factory Helpers', () => {
...defaultPluginOptions,
// Use a custom plugin to intercept contexts to verify it at initialization.
customPlugins: ({ context }) => {
const bundlerName = context.bundler.fullName;
const bundlerName = context.bundler.name;
initialContexts[bundlerName] = JSON.parse(JSON.stringify(context));

// These are functions, so they can't be serialized with parse/stringify.
Expand Down Expand Up @@ -47,8 +47,7 @@ describe('Factory Helpers', () => {
const context = initialContexts[name];
expect(context).toBeDefined();
expect(context.auth).toEqual(defaultPluginOptions.auth);
expect(context.bundler.name).toBe(name.replace(context.bundler.variant || '', ''));
expect(context.bundler.fullName).toBe(name);
expect(context.bundler.name).toBe(name);
expect(BUNDLER_VERSIONS[name]).toBeTruthy();
expect(BUNDLER_VERSIONS[name]).toEqual(expect.any(String));
expect(context.bundler.version).toBe(BUNDLER_VERSIONS[name]);
Expand Down
12 changes: 4 additions & 8 deletions packages/factory/src/helpers/logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { datadogEsbuildPlugin } from '@datadog/esbuild-plugin';
import { datadogRollupPlugin } from '@datadog/rollup-plugin';
import { datadogRspackPlugin } from '@datadog/rspack-plugin';
import { datadogVitePlugin } from '@datadog/vite-plugin';
import { datadogWebpackPlugin } from '@datadog/webpack-plugin';
import { rm } from '@dd/core/helpers/fs';
import { getSendLog } from '@dd/core/helpers/log';
import { getUniqueId } from '@dd/core/helpers/strings';
import type {
BundlerFullName,
BundlerName,
GetPluginsArg,
GlobalData,
GlobalStores,
Expand All @@ -20,7 +21,6 @@ import type {
import { getLoggerFactory, NAME_SEP } from '@dd/factory/helpers/logger';
import { getAsyncQueuePlugins } from '@dd/internal-async-queue-plugin';
import { prepareWorkingDir } from '@dd/tests/_jest/helpers/env';
import { getWebpackPlugin } from '@dd/tests/_jest/helpers/getWebpackPlugin';
import {
defaultEntry,
defaultPluginOptions,
Expand All @@ -29,11 +29,8 @@ import {
} from '@dd/tests/_jest/helpers/mocks';
import { BUNDLERS } from '@dd/tests/_jest/helpers/runBundlers';
import { allBundlers } from '@dd/tools/bundlers';
// import { allPlugins } from '@dd/tools/plugins';
import path from 'path';
import stripAnsi from 'strip-ansi';
import webpack4 from 'webpack4';
import webpack5 from 'webpack5';

// Keep a reference to console.log for debugging.
const log = console.log;
Expand Down Expand Up @@ -410,9 +407,8 @@ describe('logger', () => {

// Using these plugins to target the dev files,
// so the mocks are correctly injected.
const allPlugins: Record<BundlerFullName, (config: Options) => any> = {
webpack4: (config) => getWebpackPlugin(config, webpack4),
webpack5: (config) => getWebpackPlugin(config, webpack5),
const allPlugins: Record<BundlerName, (config: Options) => any> = {
webpack: (config) => datadogWebpackPlugin(config),
rspack: (config) => datadogRspackPlugin(config),
esbuild: (config) => datadogEsbuildPlugin(config),
rollup: (config) => datadogRollupPlugin(config),
Expand Down
4 changes: 2 additions & 2 deletions packages/factory/src/helpers/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ export const getLogFn = (
}

const buildName = data.metadata?.name ? `${data.metadata.name}|` : '';
const prefix = `[${buildName}${type}|${data.bundler.fullName}|${cleanedName}]`;
const prefix = `[${buildName}${type}|${data.bundler.name}|${cleanedName}]`;

// Keep a trace of the log in the build report.
const content = typeof text === 'string' ? text : JSON.stringify(text, null, 2);
stores.logs.push({
bundler: data.bundler.fullName,
bundler: data.bundler.name,
pluginName: name,
type,
message: content,
Expand Down
4 changes: 0 additions & 4 deletions packages/factory/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// will be updated using the 'yarn cli integrity' command.

import type {
BundlerFullName,
BundlerName,
Env,
FactoryMeta,
Expand Down Expand Up @@ -87,13 +86,10 @@ export const buildPluginFactory = ({
// - rspack.rspackVersion
const bundlerVersion = bundler.rspackVersion || bundler.version || bundler.VERSION;
const bundlerName = unpluginMetaContext.framework as BundlerName;
const bundlerVariant = bundlerName === 'webpack' ? bundlerVersion.split('.')[0] : '';

const data: GlobalData = {
bundler: {
name: bundlerName,
fullName: `${bundlerName}${bundlerVariant}` as BundlerFullName,
variant: bundlerVariant,
version: bundlerVersion,
},
env,
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/async-queue/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Async Queue Plugin', () => {
name: 'test-plugin',
buildStart: () => {
// Add promises to the queue
context.queue(mockFn(context.bundler.fullName));
context.queue(mockFn(context.bundler.name));
},
},
];
Expand All @@ -55,7 +55,7 @@ describe('Async Queue Plugin', () => {
name: 'test-plugin',
buildStart: () => {
// Add failing promise to the queue
context.queue(mockFn(context.bundler.fullName));
context.queue(mockFn(context.bundler.name));
},
},
];
Expand Down
10 changes: 4 additions & 6 deletions packages/plugins/build-report/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ const getPluginConfig: (
{
name: 'custom-plugin',
bundlerReport: (report) => {
const bundlerName = report.fullName;
const bundlerName = report.name;

bundlerOutdir[bundlerName] = report.outDir;
},
buildReport: (report) => {
// Freeze them in time by deep cloning them safely.
const bundlerName = report.bundler.fullName;
const bundlerName = report.bundler.name;
const serializedBuildReport = serializeBuildReport(report);
buildReports[bundlerName] = unserializeBuildReport(serializedBuildReport);
},
Expand Down Expand Up @@ -197,8 +197,7 @@ describe('Build Report Plugin', () => {
getComplexBuildOverrides({
rollup: rollupExternals,
vite: rollupExternals,
webpack4: xpackExternals,
webpack5: xpackExternals,
webpack: xpackExternals,
rspack: xpackExternals,
esbuild: {
external: ['supports-color'],
Expand Down Expand Up @@ -577,8 +576,7 @@ describe('Build Report Plugin', () => {
entryPoints: entries,
},
// Mode production makes the build waaaaayyyyy too slow.
webpack5: { mode: 'none', entry: entries },
webpack4: { mode: 'none', entry: entries },
webpack: { mode: 'none', entry: entries },
};
await runBundlers(
getPluginConfig(bundlerOutdir, buildReports, { logLevel: 'error', telemetry: {} }),
Expand Down
43 changes: 16 additions & 27 deletions packages/plugins/build-report/src/xpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,13 @@ export const getXpackPlugin =
// Ignore unidentified modules and runtimes.
!!moduleIdentifier &&
!moduleIdentifier.startsWith('webpack/runtime') &&
!moduleIdentifier.includes('/webpack4/buildin/') &&
!moduleIdentifier.startsWith('multi ') &&
!isInjectionFile(moduleIdentifier)
);
};

/**
* Let's get build data from webpack 4 and 5.
* Let's get build data from webpack.
* 1. Build a dependency graph from all the initial modules once they're finished
* In afterEmit, modules are concatenated and obfuscated.
* 2. Once the build is finished and emitted, we can compute the outputs and the entries.
Expand Down Expand Up @@ -350,22 +349,16 @@ export const getXpackPlugin =
for (const chunk of chunks) {
const files = getChunkFiles(chunk);

const chunkModules = (
chunkGraph
? // @ts-expect-error: Reconciliating Webpack 4, Webpack 5 and Rspack is hard.
chunkGraph?.getChunkModules(chunk)
: // This one is for webpack 4.
'getModules' in chunk && typeof chunk.getModules === 'function'
? (chunk.getModules() as Module[])
: []
)
.flatMap((m) => {
// modules exists but isn't in the types.
return 'modules' in m && Array.isArray(m.modules)
? m.modules.map((m2) => m2.identifier())
: m.identifier();
})
.filter(isModuleSupported);
const chunkModules =
// @ts-expect-error: Reconciliating Webpack 5 and Rspack is hard.
(chunkGraph?.getChunkModules(chunk) || [])
.flatMap((m) => {
// modules exists but isn't in the types.
return 'modules' in m && Array.isArray(m.modules)
? m.modules.map((m2) => m2.identifier())
: m.identifier();
})
.filter(isModuleSupported);

for (const file of files) {
if (getType(file) === 'map') {
Expand Down Expand Up @@ -442,18 +435,14 @@ export const getXpackPlugin =
const entryInputs: Map<string, Input> = new Map();
let size = 0;
const entryFiles = entrypoint.chunks.flatMap(getChunkFiles);

// FIXME This is not a 100% reliable way to get the entry filename.
const entryFilename = entrypoint.chunks
// Get the chunks that have entry modules.
.filter((chunk: Chunk) =>
chunkGraph
? // @ts-expect-error: Reconciliating Webpack 4, Webpack 5 and Rspack is hard.
chunkGraph.getChunkEntryModulesIterable(chunk)
: // This one is for webpack 4.
'hasEntryModule' in chunk &&
typeof chunk.hasEntryModule === 'function'
? chunk.hasEntryModule()
: false,
.filter(
(chunk: Chunk) =>
// @ts-expect-error: Reconciliating Webpack 5 and Rspack is hard.
chunkGraph.getChunkEntryModulesIterable(chunk) || false,
)
// Get the files of those chunks.
.flatMap((c) => Array.from(c.files))
Expand Down
2 changes: 0 additions & 2 deletions packages/plugins/bundler-report/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ It is useful to unify some configurations.
{
bundler: {
name: string;
fullName: string; // Including its variant.
outDir: string; // Output directory
// Added in `buildStart`.
rawConfig?: any;
variant: string; // Major version of the bundler (webpack 4, webpack 5)
};
}
```
Expand Down
Loading