diff --git a/packages/rspack-test-tools/etc/test-tools.api.md b/packages/rspack-test-tools/etc/test-tools.api.md index 7e35aa64f14..e978ec6821b 100644 --- a/packages/rspack-test-tools/etc/test-tools.api.md +++ b/packages/rspack-test-tools/etc/test-tools.api.md @@ -202,8 +202,6 @@ export function createWatchNewIncrementalCase(name: string, src: string, dist: s export class DefaultsConfigProcessor extends SimpleTaskProcessor { constructor(_defaultsConfigOptions: IDefaultsConfigProcessorOptions); // (undocumented) - static addSnapshotSerializer(expectImpl: jest.Expect): void; - // (undocumented) after(context: ITestContext): Promise; // (undocumented) afterAll(context: ITestContext): Promise; @@ -249,13 +247,6 @@ export class DiagnosticProcessor extends BasicProcessor protected _diagnosticOptions: IDiagnosticProcessorOptions; } -// @public (undocumented) -class Diff { - constructor(value: string); - // (undocumented) - value: string; -} - // @public (undocumented) export class DiffComparator { constructor(options: IDiffComparatorOptions); @@ -346,8 +337,6 @@ export enum EEsmMode { export class ErrorProcessor extends SimpleTaskProcessor { constructor(_errorOptions: IErrorProcessorOptions); // (undocumented) - static addSnapshotSerializer(expectImpl: jest.Expect): void; - // (undocumented) check(env: ITestEnv, context: ITestContext): Promise; // (undocumented) compiler(context: ITestContext): Promise; @@ -605,7 +594,7 @@ export interface IDefaultsConfigProcessorOptions { // (undocumented) cwd?: string; // (undocumented) - diff: (diff: jest.JestMatchers, defaults: jest.JestMatchers>) => Promise; + diff: (diff: jest.JestMatchers, defaults: jest.JestMatchers>) => Promise; // (undocumented) name: string; // (undocumented) @@ -695,7 +684,7 @@ export interface IErrorProcessorOptions { // (undocumented) build?: (context: ITestContext, compiler: TCompiler) => Promise; // (undocumented) - check?: (stats: TStatsDiagnostics) => Promise; + check?: (stats: RspackStatsDiagnostics) => Promise; // (undocumented) compilerType: T; // (undocumented) @@ -1150,6 +1139,22 @@ export class RspackDiffConfigPlugin implements RspackPluginInstance { name: string; } +// @public (undocumented) +class RspackStatsDiagnostics { + constructor(errors: StatsError[], warnings: StatsError[]); + // (undocumented) + errors: StatsError[]; + // (undocumented) + warnings: StatsError[]; +} + +// @public (undocumented) +class RspackTestDiff { + constructor(value: string); + // (undocumented) + value: string; +} + // @public (undocumented) export class SimpleTaskProcessor implements ITestProcessor { constructor(_options: ISimpleProcessorOptions); @@ -1190,8 +1195,6 @@ export class SnapshotProcessor extends BasicProcessor extends SimpleTaskProcessor { constructor(_statsAPIOptions: IStatsAPIProcessorOptions); // (undocumented) - static addSnapshotSerializer(expectImpl: jest.Expect): void; - // (undocumented) check(env: ITestEnv, context: ITestContext): Promise; // (undocumented) compiler(context: ITestContext): Promise; @@ -1445,12 +1448,6 @@ export type TStatsAPICaseConfig = Omit = { documentType?: EDocumentType; diff --git a/packages/rspack-test-tools/package.json b/packages/rspack-test-tools/package.json index ec071888f1f..27984e41ad0 100644 --- a/packages/rspack-test-tools/package.json +++ b/packages/rspack-test-tools/package.json @@ -61,6 +61,7 @@ "jsdom": "^25.0.0", "memfs": "4.8.1", "mkdirp": "0.5.6", + "path-serializer": "0.1.2", "pretty-format": "29.7.0", "rimraf": "3.0.2", "strip-ansi": "6.0.1", diff --git a/packages/rspack-test-tools/src/case/error.ts b/packages/rspack-test-tools/src/case/error.ts index 357358e53a6..3c56f615c17 100644 --- a/packages/rspack-test-tools/src/case/error.ts +++ b/packages/rspack-test-tools/src/case/error.ts @@ -18,7 +18,6 @@ export function createErrorCase( testConfig: string ) { if (!addedSerializer) { - ErrorProcessor.addSnapshotSerializer(expect); addedSerializer = true; } const caseConfig = require(testConfig); diff --git a/packages/rspack-test-tools/src/case/stats-api.ts b/packages/rspack-test-tools/src/case/stats-api.ts index 167249d0a7e..11b6e3786aa 100644 --- a/packages/rspack-test-tools/src/case/stats-api.ts +++ b/packages/rspack-test-tools/src/case/stats-api.ts @@ -21,7 +21,6 @@ export function createStatsAPICase( testConfig: string ) { if (!addedSerializer) { - StatsAPIProcessor.addSnapshotSerializer(expect); addedSerializer = true; } const caseConfig: TStatsAPICaseConfig = require(testConfig); diff --git a/packages/rspack-test-tools/src/helper/expect/char.ts b/packages/rspack-test-tools/src/helper/expect/char.ts new file mode 100644 index 00000000000..1afa4c8c41e --- /dev/null +++ b/packages/rspack-test-tools/src/helper/expect/char.ts @@ -0,0 +1,23 @@ +export const normalizeCRLF = (str: string): string => { + return str.replace(/\r\n?/g, "\n"); +}; + +export const normalizeCLR = (str: string): string => { + return ( + str + .replace(/\u001b\[1m\u001b\[([0-9;]*)m/g, "") + .replace(/\u001b\[1m/g, "") + .replace(/\u001b\[39m\u001b\[22m/g, "") + .replace(/\u001b\[([0-9;]*)m/g, "") + // CHANGE: The time unit display in Rspack is second + .replace(/[.0-9]+(<\/CLR>)?(\s?s)/g, "X$1$2") + ); +}; + +export const normalizeColor = (str: string): string => { + return str.replace(/\u001b\[[0-9;]*m/g, ""); +}; + +export const normalizeSlash = (str: string): string => { + return str.replace(/(\\)+/g, "/"); +}; diff --git a/packages/rspack-test-tools/src/helper/expect/diff.ts b/packages/rspack-test-tools/src/helper/expect/diff.ts new file mode 100644 index 00000000000..31600851256 --- /dev/null +++ b/packages/rspack-test-tools/src/helper/expect/diff.ts @@ -0,0 +1,36 @@ +const CURRENT_CWD = process.cwd(); + +const quoteMeta = (str: string) => str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); +const cwdRegExp = new RegExp( + `${quoteMeta(CURRENT_CWD)}((?:\\\\)?(?:[a-zA-Z.\\-_]+\\\\)*)`, + "g" +); +const escapedCwd = JSON.stringify(CURRENT_CWD).slice(1, -1); +const escapedCwdRegExp = new RegExp( + `${quoteMeta(escapedCwd)}((?:\\\\\\\\)?(?:[a-zA-Z.\\-_]+\\\\\\\\)*)`, + "g" +); + +export const normalizeDiff = (diff: { value: string }) => { + let normalizedStr: string = diff.value; + if (CURRENT_CWD.startsWith("/")) { + normalizedStr = normalizedStr.replace( + new RegExp(quoteMeta(CURRENT_CWD), "g"), + "" + ); + } else { + normalizedStr = normalizedStr.replace( + cwdRegExp, + (_, g) => `${g.replace(/\\/g, "/")}` + ); + normalizedStr = normalizedStr.replace( + escapedCwdRegExp, + (_, g) => `${g.replace(/\\\\/g, "/")}` + ); + } + normalizedStr = normalizedStr.replace( + /@@ -\d+,\d+ \+\d+,\d+ @@/g, + "@@ ... @@" + ); + return normalizedStr; +}; diff --git a/packages/rspack-test-tools/src/helper/expect/error.ts b/packages/rspack-test-tools/src/helper/expect/error.ts new file mode 100644 index 00000000000..ff9d2c9804f --- /dev/null +++ b/packages/rspack-test-tools/src/helper/expect/error.ts @@ -0,0 +1,59 @@ +import prettyFormat from "pretty-format"; + +const ERROR_STACK_PATTERN = /(│.* at ).*/g; + +const prettyFormatOptions = { + escapeRegex: false, + printFunctionName: false, + plugins: [ + { + test(val: any) { + return typeof val === "string"; + }, + print(val: any) { + return `"${val + .replace(/\\/gm, "/") + .replace(/"/gm, '\\"') + .replace(/\r?\n/gm, "\\n")}"`; + } + } + ] +}; + +function cleanErrorStack(message: string) { + return message.replace(ERROR_STACK_PATTERN, "$1xxx"); +} + +function cleanError(err: Error) { + const result: Partial> = {}; + for (const key of Object.getOwnPropertyNames(err)) { + result[key as keyof Error] = err[key as keyof Error]; + } + + if (result.message) { + result.message = cleanErrorStack(err.message); + } + + if (result.stack) { + result.stack = cleanErrorStack(result.stack); + } + + return result; +} + +export function normalizeDignostics(received: { + errors: Error[]; + warnings: Error[]; +}): string { + return prettyFormat( + { + errors: received.errors.map(e => cleanError(e)), + warnings: received.warnings.map(e => cleanError(e)) + }, + prettyFormatOptions + ).trim(); +} + +export function normalizeError(received: Error): string { + return prettyFormat(cleanError(received), prettyFormatOptions).trim(); +} diff --git a/packages/rspack-test-tools/src/helper/expect/placeholder.ts b/packages/rspack-test-tools/src/helper/expect/placeholder.ts new file mode 100644 index 00000000000..fff6ee2a0a7 --- /dev/null +++ b/packages/rspack-test-tools/src/helper/expect/placeholder.ts @@ -0,0 +1,30 @@ +import path from "node:path"; +const { createSnapshotSerializer } = require("path-serializer"); + +const placeholderSerializer = createSnapshotSerializer({ + workspace: path.resolve(__dirname, "../../../../../"), + replace: [ + { + match: path.resolve(__dirname, "../../../rspack"), + mark: "rspack" + }, + { + match: path.resolve(__dirname, "../../"), + mark: "test_tools" + }, + { + match: /:\d+:\d+-\d+:\d+/g, + mark: "line_col_range" + }, + { + match: /:\d+:\d+/g, + mark: "line_col" + } + ], + features: { + addDoubleQuotes: false, + ansiDoubleQuotes: false + } +}); + +export const normalizePlaceholder = placeholderSerializer.serialize; diff --git a/packages/rspack-test-tools/src/helper/expect/rspack.ts b/packages/rspack-test-tools/src/helper/expect/rspack.ts new file mode 100644 index 00000000000..a664c871a70 --- /dev/null +++ b/packages/rspack-test-tools/src/helper/expect/rspack.ts @@ -0,0 +1,12 @@ +export const normalizeStats = (stats: { value: string }): string => { + return ( + stats.value + // CHANGE: Remove potential line break and "|" caused by long text + .replace(/((ERROR|WARNING)([\s\S](?!╭|├))*?)(\n {2}│ )/g, "$1") + // CHANGE: Update the regular expression to replace the 'Rspack' version string + .replace(/Rspack [^ )]+(\)?) compiled/g, "Rspack x.x.x$1 compiled") + .replace(/(\w)\\(\w)/g, "$1/$2") + .replace(/, additional resolving: X ms/g, "") + .replace(/Unexpected identifier '.+?'/g, "Unexpected identifier") + ); +}; diff --git a/packages/rspack-test-tools/src/helper/setup-expect.ts b/packages/rspack-test-tools/src/helper/setup-expect.ts index 2ecb2254078..e41f3c8d40c 100644 --- a/packages/rspack-test-tools/src/helper/setup-expect.ts +++ b/packages/rspack-test-tools/src/helper/setup-expect.ts @@ -1,12 +1,81 @@ -// @ts-nocheck - +import { normalizeCLR, normalizeCRLF, normalizeSlash } from "./expect/char"; +import { normalizeDiff } from "./expect/diff"; +import { normalizeDignostics, normalizeError } from "./expect/error"; +import { normalizePlaceholder } from "./expect/placeholder"; +import { normalizeStats } from "./expect/rspack"; import { toBeTypeOf } from "./expect/to-be-typeof"; import { toEndWith } from "./expect/to-end-with"; import { toMatchFileSnapshot } from "./expect/to-match-file-snapshot"; +const { normalizePaths } = require("jest-serializer-path"); expect.extend({ // CHANGE: new test matcher for `rspack-test-tools` + // @ts-ignore toMatchFileSnapshot, toBeTypeOf, toEndWith }); + +const pipes = [ + normalizeSlash, + normalizeCLR, + normalizeCRLF, + normalizePlaceholder, + normalizePaths +]; + +const serialize = ( + str: string, + extra: Array<(str: string) => string> = [] +): string => + [...pipes, ...extra].reduce((res, transform) => transform(res), str); + +expect.addSnapshotSerializer({ + test(received) { + return typeof received === "string"; + }, + print(received) { + return serialize((received as string).trim()); + } +}); + +// for diff +expect.addSnapshotSerializer({ + test(received) { + return received?.constructor?.name === "RspackTestDiff"; + }, + print(received, next) { + return next(normalizeDiff(received as { value: string })); + } +}); + +// for errors +expect.addSnapshotSerializer({ + test(received) { + return received?.constructor?.name === "RspackStatsDiagnostics"; + }, + print(received, next) { + return next( + normalizeDignostics(received as { errors: Error[]; warnings: Error[] }) + ); + } +}); + +expect.addSnapshotSerializer({ + test(received) { + return typeof received?.message === "string"; + }, + print(received, next) { + return next(normalizeError(received as Error)); + } +}); + +// for stats +expect.addSnapshotSerializer({ + test(received) { + return received?.constructor?.name === "RspackStats"; + }, + print(received, next) { + return next(normalizeStats(received as { value: string })); + } +}); diff --git a/packages/rspack-test-tools/src/processor/defaults.ts b/packages/rspack-test-tools/src/processor/defaults.ts index 9bdb6e593cc..9950dfc8e6b 100644 --- a/packages/rspack-test-tools/src/processor/defaults.ts +++ b/packages/rspack-test-tools/src/processor/defaults.ts @@ -11,42 +11,7 @@ import { SimpleTaskProcessor } from "./simple"; const CURRENT_CWD = process.cwd(); -const quoteMeta = (str: string) => str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); -const cwdRegExp = new RegExp( - `${quoteMeta(CURRENT_CWD)}((?:\\\\)?(?:[a-zA-Z.\\-_]+\\\\)*)`, - "g" -); -const escapedCwd = JSON.stringify(CURRENT_CWD).slice(1, -1); -const escapedCwdRegExp = new RegExp( - `${quoteMeta(escapedCwd)}((?:\\\\\\\\)?(?:[a-zA-Z.\\-_]+\\\\\\\\)*)`, - "g" -); -const normalize = (str: string) => { - let normalizedStr: string; - if (CURRENT_CWD.startsWith("/")) { - normalizedStr = str.replace( - new RegExp(quoteMeta(CURRENT_CWD), "g"), - "" - ); - } else { - normalizedStr = str.replace( - cwdRegExp, - (_, g) => `${g.replace(/\\/g, "/")}` - ); - normalizedStr = normalizedStr.replace( - escapedCwdRegExp, - (_, g) => `${g.replace(/\\\\/g, "/")}` - ); - } - - normalizedStr = normalizedStr.replace( - /@@ -\d+,\d+ \+\d+,\d+ @@/g, - "@@ ... @@" - ); - return normalizedStr; -}; - -class Diff { +class RspackTestDiff { constructor(public value: string) {} } @@ -55,7 +20,7 @@ export interface IDefaultsConfigProcessorOptions { cwd?: string; name: string; diff: ( - diff: jest.JestMatchers, + diff: jest.JestMatchers, defaults: jest.JestMatchers> ) => Promise; compilerType: T; @@ -104,7 +69,7 @@ export class DefaultsConfigProcessor< jestDiff(this.defaultConfig, config, { expand: false, contextLines: 0 })! ); await this._defaultsConfigOptions.diff( - env.expect(new Diff(diff)), + env.expect(new RspackTestDiff(diff)), env.expect(this.defaultConfig) ); } @@ -133,24 +98,4 @@ export class DefaultsConfigProcessor< process.chdir(CURRENT_CWD); return normalizedConfig; } - - static addSnapshotSerializer(expectImpl: jest.Expect) { - expectImpl.addSnapshotSerializer({ - test(value) { - return value instanceof Diff; - }, - print(received) { - return normalize((received as Diff).value); - } - }); - - expectImpl.addSnapshotSerializer({ - test(value) { - return typeof value === "string"; - }, - print(received) { - return JSON.stringify(normalize(received as string)); - } - }); - } } diff --git a/packages/rspack-test-tools/src/processor/error.ts b/packages/rspack-test-tools/src/processor/error.ts index cc5e6683d6a..f0314f9667b 100644 --- a/packages/rspack-test-tools/src/processor/error.ts +++ b/packages/rspack-test-tools/src/processor/error.ts @@ -1,7 +1,6 @@ import type fs from "node:fs"; import path from "node:path"; import type { StatsError } from "@rspack/core"; -import prettyFormat from "pretty-format"; import merge from "webpack-merge"; import type { @@ -13,66 +12,13 @@ import type { } from "../type"; import { SimpleTaskProcessor } from "./simple"; -type TStatsDiagnostics = { - errors: StatsError[]; - warnings: StatsError[]; -}; - -const CWD_PATTERN = new RegExp( - path.join(process.cwd(), "../../").replace(/\\/g, "/"), - "gm" -); -const ERROR_STACK_PATTERN = /(│.* at ).*/g; - -function cleanErrorStack(message: string) { - return message.replace(ERROR_STACK_PATTERN, "$1xxx"); -} - -function cleanError(err: Error) { - const result: Partial> = {}; - for (const key of Object.getOwnPropertyNames(err)) { - result[key as keyof Error] = err[key as keyof Error]; - } - - if (result.message) { - result.message = cleanErrorStack(err.message); - } - - if (result.stack) { - result.stack = cleanErrorStack(result.stack); - } - - return result; -} - -function serialize(received: unknown) { - return ( - prettyFormat(received, prettyFormatOptions) - .replace(CWD_PATTERN, "") - // replace line numbers in error stacks - .replace(/:\d+:\d+/g, "::") - .trim() - ); +class RspackStatsDiagnostics { + constructor( + public errors: StatsError[], + public warnings: StatsError[] + ) {} } -const prettyFormatOptions = { - escapeRegex: false, - printFunctionName: false, - plugins: [ - { - test(val: any) { - return typeof val === "string"; - }, - print(val: any) { - return `"${val - .replace(/\\/gm, "/") - .replace(/"/gm, '\\"') - .replace(/\r?\n/gm, "\\n")}"`; - } - } - ] -}; - export interface IErrorProcessorOptions { name: string; compilerType: T; @@ -81,7 +27,7 @@ export interface IErrorProcessorOptions { context: ITestContext ) => TCompilerOptions; build?: (context: ITestContext, compiler: TCompiler) => Promise; - check?: (stats: TStatsDiagnostics) => Promise; + check?: (stats: RspackStatsDiagnostics) => Promise; } export class ErrorProcessor< @@ -165,36 +111,11 @@ export class ErrorProcessor< env.expect(Array.isArray(errors)).toBe(true); env.expect(Array.isArray(warnings)).toBe(true); - await this._errorOptions.check?.({ - errors: errors as StatsError[], - warnings: warnings as StatsError[] - }); - } - - static addSnapshotSerializer(expectImpl: jest.Expect) { - expectImpl.addSnapshotSerializer({ - test(received) { - return received.errors || received.warnings; - }, - print(received) { - return serialize({ - errors: (received as TStatsDiagnostics).errors.map(e => - cleanError(e as unknown as Error) - ), - warnings: (received as TStatsDiagnostics).warnings.map(e => - cleanError(e as unknown as Error) - ) - }); - } - }); - - expectImpl.addSnapshotSerializer({ - test(received) { - return received.message; - }, - print(received) { - return serialize(cleanError(received as Error)); - } - }); + await this._errorOptions.check?.( + new RspackStatsDiagnostics( + errors as StatsError[], + warnings as StatsError[] + ) + ); } } diff --git a/packages/rspack-test-tools/src/processor/stats-api.ts b/packages/rspack-test-tools/src/processor/stats-api.ts index d2b452f4ae2..c09ce356efa 100644 --- a/packages/rspack-test-tools/src/processor/stats-api.ts +++ b/packages/rspack-test-tools/src/processor/stats-api.ts @@ -10,7 +10,6 @@ import type { TCompilerStats } from "../type"; import { SimpleTaskProcessor } from "./simple"; -const serializer = require("jest-serializer-path"); export interface IStatsAPIProcessorOptions { options?: (context: ITestContext) => TCompilerOptions; @@ -62,8 +61,4 @@ export class StatsAPIProcessor< env.expect(typeof stats).toBe("object"); await this._statsAPIOptions.check?.(stats!, compiler.getCompiler()!); } - - static addSnapshotSerializer(expectImpl: jest.Expect) { - expectImpl.addSnapshotSerializer(serializer); - } } diff --git a/packages/rspack-test-tools/src/processor/stats.ts b/packages/rspack-test-tools/src/processor/stats.ts index 4d35cd6dba3..ba80d2050af 100644 --- a/packages/rspack-test-tools/src/processor/stats.ts +++ b/packages/rspack-test-tools/src/processor/stats.ts @@ -16,9 +16,10 @@ export interface IStatsProcessorOptions extends Omit, "runable"> {} const REG_ERROR_CASE = /error$/; -const quoteMeta = (str: string) => { - return str.replace(/[-[\]\\/{}()*+?.^$|]/g, "\\$&"); -}; + +class RspackStats { + constructor(public value: string) {} +} export class StatsProcessor< T extends ECompilerType @@ -150,39 +151,14 @@ export class StatsProcessor< let actual = stats.toString(toStringOptions); env.expect(typeof actual).toBe("string"); + actual = this.stderr.toString() + actual; if (!hasColorSetting) { - actual = this.stderr.toString() + actual; actual = actual .replace(/\u001b\[[0-9;]*m/g, "") // CHANGE: The time unit display in Rspack is second .replace(/[.0-9]+(\s?s)/g, "X$1"); - } else { - actual = this.stderr.toStringRaw() + actual; - // eslint-disable-no-control-regex - actual = actual - .replace(/\u001b\[1m\u001b\[([0-9;]*)m/g, "") - .replace(/\u001b\[1m/g, "") - .replace(/\u001b\[39m\u001b\[22m/g, "") - .replace(/\u001b\[([0-9;]*)m/g, "") - // CHANGE: The time unit display in Rspack is second - .replace(/[.0-9]+(<\/CLR>)?(\s?s)/g, "X$1$2"); } - // cspell:ignore Xdir - const testPath = context.getSource(); - actual = actual - .replace(/\r\n?/g, "\n") - // CHANGE: Remove potential line break and "|" caused by long text - .replace(/((ERROR|WARNING)([\s\S](?!╭|├))*?)(\n {2}│ )/g, "$1") - // CHANGE: Update the regular expression to replace the 'Rspack' version string - .replace(/Rspack [^ )]+(\)?) compiled/g, "Rspack x.x.x$1 compiled") - .replace( - new RegExp(quoteMeta(testPath), "g"), - `Xdir/${path.basename(this._options.name)}` - ) - .replace(/(\w)\\(\w)/g, "$1/$2") - .replace(/, additional resolving: X ms/g, "") - .replace(/Unexpected identifier '.+?'/g, "Unexpected identifier"); - env.expect(actual).toMatchSnapshot(); + env.expect(new RspackStats(actual)).toMatchSnapshot(); const testConfig = context.getTestConfig(); if (typeof testConfig?.validate === "function") { testConfig.validate(stats, this.stderr.toString()); diff --git a/packages/rspack-test-tools/tests/Defaults.test.js b/packages/rspack-test-tools/tests/Defaults.test.js index 792a1f405e6..22135ad5859 100644 --- a/packages/rspack-test-tools/tests/Defaults.test.js +++ b/packages/rspack-test-tools/tests/Defaults.test.js @@ -47,8 +47,6 @@ function trimObjectPaths(obj, paths) { return deleteObjectPaths(obj, fullPath => paths.some(p => p.length === fullPath.length && p.every((e, i) => e === fullPath[i]))); } -DefaultsConfigProcessor.addSnapshotSerializer(expect); - const cwd = path.resolve(__dirname, ".."); function assertWebpackConfig(config) { diff --git a/packages/rspack-test-tools/tests/Validation.test.js b/packages/rspack-test-tools/tests/Validation.test.js index cf1c7de53d1..cbd09277f57 100644 --- a/packages/rspack-test-tools/tests/Validation.test.js +++ b/packages/rspack-test-tools/tests/Validation.test.js @@ -53,8 +53,8 @@ describe("Validation", () => { log => { expect(log).toMatchInlineSnapshot(` Array [ - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - Unrecognized key(s) in object: '_additionalProperty'", + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - Unrecognized key(s) in object: '_additionalProperty', ] `); } @@ -74,8 +74,8 @@ describe("Validation", () => { log => { expect(log).toMatchInlineSnapshot(` Array [ - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - Unrecognized key(s) in object: '_additionalProperty' at \\"optimization\\"", + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - Unrecognized key(s) in object: '_additionalProperty' at "optimization", ] `); } @@ -88,8 +88,8 @@ describe("Validation", () => { }, message => { expect(message).toMatchInlineSnapshot(` - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - The provided value \\"./\\" must be an absolute path. at \\"context\\"" + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - The provided value "./" must be an absolute path. at "context" `); }, "loose-unrecognized-keys", @@ -106,16 +106,16 @@ describe("Validation", () => { }, message => { expect(message).toMatchInlineSnapshot(` - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - The provided value \\"./\\" must be an absolute path. at \\"context\\"" + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - The provided value "./" must be an absolute path. at "context" `); }, "loose-unrecognized-keys", log => { expect(log).toMatchInlineSnapshot(` Array [ - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - Unrecognized key(s) in object: '_additionalProperty'", + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - Unrecognized key(s) in object: '_additionalProperty', ] `); } @@ -139,10 +139,10 @@ describe("Validation", () => { log => { expect(log).toMatchInlineSnapshot(` Array [ - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - The provided value \\"./\\" must be an absolute path. at \\"context\\" - - Unrecognized key(s) in object: '_additionalProperty' at \\"optimization\\" - - Unrecognized key(s) in object: '_additionalProperty'", + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - The provided value "./" must be an absolute path. at "context" + - Unrecognized key(s) in object: '_additionalProperty' at "optimization" + - Unrecognized key(s) in object: '_additionalProperty', ] `); } @@ -157,8 +157,8 @@ describe("Validation", () => { }, message => { expect(message).toMatchInlineSnapshot(` - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - The provided value \\"./\\" must be an absolute path. at \\"context\\"" + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - The provided value "./" must be an absolute path. at "context" `); }, "strict", @@ -178,10 +178,10 @@ describe("Validation", () => { }, message => { expect(message).toMatchInlineSnapshot(` - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - The provided value \\"./\\" must be an absolute path. at \\"context\\" - - Unrecognized key(s) in object: '_additionalProperty' at \\"optimization\\" - - Unrecognized key(s) in object: '_additionalProperty'" + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - The provided value "./" must be an absolute path. at "context" + - Unrecognized key(s) in object: '_additionalProperty' at "optimization" + - Unrecognized key(s) in object: '_additionalProperty' `); }, "strict", @@ -199,8 +199,8 @@ describe("Validation", () => { }, message => { expect(message).toMatchInlineSnapshot(` - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - The provided value \\"./\\" must be an absolute path. at \\"context\\"" + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - The provided value "./" must be an absolute path. at "context" `); }, log => { @@ -219,10 +219,10 @@ describe("Validation", () => { }, message => { expect(message).toMatchInlineSnapshot(` - "Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. - - The provided value \\"./\\" must be an absolute path. at \\"context\\" - - Unrecognized key(s) in object: '_additionalProperty' at \\"optimization\\" - - Unrecognized key(s) in object: '_additionalProperty'" + Invalid configuration object. Rspack has been initialized using a configuration object that does not match the API schema. + - The provided value "./" must be an absolute path. at "context" + - Unrecognized key(s) in object: '_additionalProperty' at "optimization" + - Unrecognized key(s) in object: '_additionalProperty' `); }, log => { diff --git a/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap index 037a2ab64d4..239d8175525 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap @@ -1,232 +1,232 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`config config/builtin-lightningcss-loader/basic-include exported tests should transform css correct 1`] = ` -"body { +body { & ._-ca56f23580d7bbb484-used { color: #00f; } } -head{--webpack--909:used:_-ca56f23580d7bē484-ĀĂ/&_368;}" +head{--webpack--909:used:_-ca56f23580d7bē484-ĀĂ/&_368;} `; exports[`config config/builtin-lightningcss-loader/minify exported tests css content minifyed 1`] = ` -".foo{-webkit-transition:all .5s;transition:all .5s}.bar{padding:0} -head{--webpack--909:&_487;}" +.foo{-webkit-transition:all Xs;transition:all Xs}.bar{padding:0} +head{--webpack--909:&_487;} `; exports[`config config/builtins/css-auto exported tests css/auto can handle css module correctly 1`] = ` Object { - "style": "-ca56f23580d7bbb484-style", + style: -ca56f23580d7bbb484-style, } `; exports[`config config/builtins/css-modules-composes exported tests css modules composes 1`] = ` Object { - "simple-bar": "-a7200a43b5c2530b1414-simple-bar -f27007fff641a72c371d-imported-simple", - "simple-foo": "-a7200a43b5c2530b1414-simple-foo -f27007fff641a72c371d-imported-simple", + simple-bar: -a7200a43b5c2530b1414-simple-bar -f27007fff641a72c371d-imported-simple, + simple-foo: -a7200a43b5c2530b1414-simple-foo -f27007fff641a72c371d-imported-simple, } `; exports[`config config/builtins/css-modules-composes-preprocessers exported tests css modules with css preprocessers 1`] = ` Object { - "class": "-a7200a43b5c2530b1414-class -feb80f2fe6d30-lessClass", - "ghi": "-a7200a43b5c2530b1414-ghi", - "other": "-a7200a43b5c2530b1414-other -ebd90a48d100efd-scssClass", - "otherClassName": "-a7200a43b5c2530b1414-otherClassName globalClassName", + class: -a7200a43b5c2530b1414-class -feb80f2fe6d30-lessClass, + ghi: -a7200a43b5c2530b1414-ghi, + other: -a7200a43b5c2530b1414-other -ebd90a48d100efd-scssClass, + otherClassName: -a7200a43b5c2530b1414-otherClassName globalClassName, } `; exports[`config config/builtins/css-modules-composes-sass exported tests css modules in scss 1`] = ` Object { - "bar": "-f1f00e6e62b9a7fadb02-bar -a3b1929b59eeacf15a4-foo", + bar: -f1f00e6e62b9a7fadb02-bar -a3b1929b59eeacf15a4-foo, } `; exports[`config config/builtins/css-modules-dedupe exported tests css modules dedupe 1`] = ` Object { - "backButton": "-baa5c4d806a1671b-backButton -e683a459bd7b289e1b8d-secondaryButton -d8686a334ddc6bdd0-button", - "nextButton": "-baa5c4d806a1671b-nextButton -a510fa2734ece860e70-primaryButton -d8686a334ddc6bdd0-button", + backButton: -baa5c4d806a1671b-backButton -e683a459bd7b289e1b8d-secondaryButton -d8686a334ddc6bdd0-button, + nextButton: -baa5c4d806a1671b-nextButton -a510fa2734ece860e70-primaryButton -d8686a334ddc6bdd0-button, } `; exports[`config config/builtins/css-modules-exports-only exported tests css modules exportsOnly 1`] = ` Object { - "simple-bar": "-a7200a43b5c2530b1414-simple-bar -f27007fff641a72c371d-imported-simple", - "simple-foo": "-a7200a43b5c2530b1414-simple-foo -f27007fff641a72c371d-imported-simple", + simple-bar: -a7200a43b5c2530b1414-simple-bar -f27007fff641a72c371d-imported-simple, + simple-foo: -a7200a43b5c2530b1414-simple-foo -f27007fff641a72c371d-imported-simple, } `; exports[`config config/builtins/css-modules-local-ident-name-hash exported tests css modules localIdentName with hash 1`] = ` Object { - "#": "ccc05d01b5ed91e5a4d", - "##": "c16d3dd30b7cca2d412d", - "#.#.#": "c6e8935740a6209cd48e", - "#fake-id": "c053ba4f7badbc242", - "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.": "f5775dd999dc95dd350", - "-a-b-c-": "e171381fc62026ffe05b", - "-a0-34a___f": "e6419db424263d77191e", - ".": "b1061101d3ff1517822", - "123": "c6f16686ef1ceab9728", - "1a2b3c": "ea6ff32ba4e9ad9e4c71", - ":)": "c8ad14da9eacd8206f95", - ":\`(": "ab034bce3407ac44d", - ":hover": "d64a685363ea14300", - ":hover:focus:active": "f1ba6ba717fdcfbecc52", - "<><<<>><>": "a8471bf6e63738086bfa", - "

": "f4a8269a3b7c6f38759d", - "?": "d4a79a8d3ea0285a", - "@": "dba948edd127566bb", - "B&W?": "d26b7b08b3ee0fec8093", - "[attr=value]": "cf98e323da83a7ef1", - "_": "b21bb2384964fa8226c0", - "_test": "acd3c0528ed3c3330", - "className": "a20f38af3e2122251", - "f!o!o": "a4a2e3c31408bb709fb", - "f'o'o": "c1712d83c24d5b7bd9d", - "f*o*o": "f5ce693ef2ea116b05", - "f+o+o": "e3714c708c213b9e", - "f/o/o": "cd9b24dbefa12afeaba5", - "f\\\\o\\\\o": "f90fa90fb52121fce923", - "foo.bar": "a7554930d53d1d95676", - "foo/bar": "e21d87979464d92960b9", - "foo/bar/baz": "e26519aba0f8e105eb13", - "foo\\\\bar": "f93c23331183aeac60", - "foo\\\\bar\\\\baz": "aa79627c6f36d0c8f9", - "f~o~o": "f4c89337b4a84e05", - "m_x_@": "f106c601eea0160783bb", - "someId": "f7dad309581ff59a8c1", - "subClass": "f904cf1d95567c868707", - "test": "c8e76de9832d60b206c2", - "{}": "e73bdae84335b77", - "©": "d4c6ea8dbaf492a7e42e", - "“‘’”": "d3df6d853c11234b8", - "⌘⌥": "bbb74fa7684d2b07", - "☺☃": "d09672ed2a23417fa543", - "♥": "f5682d5025ab700972a0", - "𝄞♪♩♫♬": "b7e928b15b6057d2f8", - "💩": "bb34b4e107a01390e3fb", - "😍": "e5439193d7906536aeac", + #: ccc05d01b5ed91e5a4d, + ##: c16d3dd30b7cca2d412d, + #.#.#: c6e8935740a6209cd48e, + #fake-id: c053ba4f7badbc242, + ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.: f5775dd999dc95dd350, + -a-b-c-: e171381fc62026ffe05b, + -a0-34a___f: e6419db424263d77191e, + .: b1061101d3ff1517822, + 123: c6f16686ef1ceab9728, + 1a2b3c: ea6ff32ba4e9ad9e4c71, + :): c8ad14da9eacd8206f95, + :\`(: ab034bce3407ac44d, + :hover: d64a685363ea14300, + :hover:focus:active: f1ba6ba717fdcfbecc52, + <><<<>><>: a8471bf6e63738086bfa, +

: f4a8269a3b7c6f38759d, + ?: d4a79a8d3ea0285a, + @: dba948edd127566bb, + B&W?: d26b7b08b3ee0fec8093, + [attr=value]: cf98e323da83a7ef1, + _: b21bb2384964fa8226c0, + _test: acd3c0528ed3c3330, + className: a20f38af3e2122251, + f!o!o: a4a2e3c31408bb709fb, + f'o'o: c1712d83c24d5b7bd9d, + f*o*o: f5ce693ef2ea116b05, + f+o+o: e3714c708c213b9e, + f/o/o: cd9b24dbefa12afeaba5, + f/o/o: f90fa90fb52121fce923, + foo.bar: a7554930d53d1d95676, + foo/bar: e21d87979464d92960b9, + foo/bar/baz: e26519aba0f8e105eb13, + foo/bar: f93c23331183aeac60, + foo/bar/baz: aa79627c6f36d0c8f9, + f~o~o: f4c89337b4a84e05, + m_x_@: f106c601eea0160783bb, + someId: f7dad309581ff59a8c1, + subClass: f904cf1d95567c868707, + test: c8e76de9832d60b206c2, + {}: e73bdae84335b77, + ©: d4c6ea8dbaf492a7e42e, + “‘’”: d3df6d853c11234b8, + ⌘⌥: bbb74fa7684d2b07, + ☺☃: d09672ed2a23417fa543, + ♥: f5682d5025ab700972a0, + 𝄞♪♩♫♬: b7e928b15b6057d2f8, + 💩: bb34b4e107a01390e3fb, + 😍: e5439193d7906536aeac, } `; exports[`config config/builtins/css-modules-local-ident-name-path exported tests css modules localIdentName with path 1`] = ` Object { - "#": "./src/index__#", - "##": "./src/index__##", - "#.#.#": "./src/index__#.#.#", - "#fake-id": "./src/index__#fake-id", - "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.": "./src/index__++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.", - "-a-b-c-": "./src/index__-a-b-c-", - "-a0-34a___f": "./src/index__-a0-34a___f", - ".": "./src/index__.", - "123": "./src/index__123", - "1a2b3c": "./src/index__1a2b3c", - ":)": "./src/index__:)", - ":\`(": "./src/index__:\`(", - ":hover": "./src/index__:hover", - ":hover:focus:active": "./src/index__:hover:focus:active", - "<><<<>><>": "./src/index__<><<<>><>", - "

": "./src/index__

", - "?": "./src/index__?", - "@": "./src/index__@", - "B&W?": "./src/index__B&W?", - "[attr=value]": "./src/index__[attr=value]", - "_": "./src/index___", - "_test": "./src/index___test", - "className": "./src/index__className", - "f!o!o": "./src/index__f!o!o", - "f'o'o": "./src/index__f'o'o", - "f*o*o": "./src/index__f*o*o", - "f+o+o": "./src/index__f+o+o", - "f/o/o": "./src/index__f/o/o", - "f\\\\o\\\\o": "./src/index__f\\\\o\\\\o", - "foo.bar": "./src/index__foo.bar", - "foo/bar": "./src/index__foo/bar", - "foo/bar/baz": "./src/index__foo/bar/baz", - "foo\\\\bar": "./src/index__foo\\\\bar", - "foo\\\\bar\\\\baz": "./src/index__foo\\\\bar\\\\baz", - "f~o~o": "./src/index__f~o~o", - "m_x_@": "./src/index__m_x_@", - "someId": "./src/index__someId", - "subClass": "./src/index__subClass", - "test": "./src/index__test", - "{}": "./src/index__{}", - "©": "./src/index__©", - "“‘’”": "./src/index__“‘’”", - "⌘⌥": "./src/index__⌘⌥", - "☺☃": "./src/index__☺☃", - "♥": "./src/index__♥", - "𝄞♪♩♫♬": "./src/index__𝄞♪♩♫♬", - "💩": "./src/index__💩", - "😍": "./src/index__😍", + #: ./src/index__#, + ##: ./src/index__##, + #.#.#: ./src/index__#.#.#, + #fake-id: ./src/index__#fake-id, + ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.: ./src/index__++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>., + -a-b-c-: ./src/index__-a-b-c-, + -a0-34a___f: ./src/index__-a0-34a___f, + .: ./src/index__., + 123: ./src/index__123, + 1a2b3c: ./src/index__1a2b3c, + :): ./src/index__:), + :\`(: ./src/index__:\`(, + :hover: ./src/index__:hover, + :hover:focus:active: ./src/index__:hover:focus:active, + <><<<>><>: ./src/index__<><<<>><>, +

: ./src/index__

, + ?: ./src/index__?, + @: ./src/index__@, + B&W?: ./src/index__B&W?, + [attr=value]: ./src/index__[attr=value], + _: ./src/index___, + _test: ./src/index___test, + className: ./src/index__className, + f!o!o: ./src/index__f!o!o, + f'o'o: ./src/index__f'o'o, + f*o*o: ./src/index__f*o*o, + f+o+o: ./src/index__f+o+o, + f/o/o: ./src/index__f/o/o, + f/o/o: ./src/index__f/o/o, + foo.bar: ./src/index__foo.bar, + foo/bar: ./src/index__foo/bar, + foo/bar/baz: ./src/index__foo/bar/baz, + foo/bar: ./src/index__foo/bar, + foo/bar/baz: ./src/index__foo/bar/baz, + f~o~o: ./src/index__f~o~o, + m_x_@: ./src/index__m_x_@, + someId: ./src/index__someId, + subClass: ./src/index__subClass, + test: ./src/index__test, + {}: ./src/index__{}, + ©: ./src/index__©, + “‘’”: ./src/index__“‘’”, + ⌘⌥: ./src/index__⌘⌥, + ☺☃: ./src/index__☺☃, + ♥: ./src/index__♥, + 𝄞♪♩♫♬: ./src/index__𝄞♪♩♫♬, + 💩: ./src/index__💩, + 😍: ./src/index__😍, } `; exports[`config config/builtins/css-modules-locals-convention-camelCase exported tests css modules localsConvention with camelCase 1`] = ` Object { - "btn--info_is-disabled_1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", - "btn-info_is-disabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", - "btnInfoIsDisabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", - "btnInfoIsDisabled1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", - "fooBar": "-a7200a43b5c2530b1414-foo_bar", - "foo_bar": "-a7200a43b5c2530b1414-foo_bar", - "simple": "-a7200a43b5c2530b1414-simple", + btn--info_is-disabled_1: -a7200a43b5c2530b1414-btn--info_is-disabled_1, + btn-info_is-disabled: -a7200a43b5c2530b1414-btn-info_is-disabled, + btnInfoIsDisabled: -a7200a43b5c2530b1414-btn-info_is-disabled, + btnInfoIsDisabled1: -a7200a43b5c2530b1414-btn--info_is-disabled_1, + fooBar: -a7200a43b5c2530b1414-foo_bar, + foo_bar: -a7200a43b5c2530b1414-foo_bar, + simple: -a7200a43b5c2530b1414-simple, } `; exports[`config config/builtins/css-modules-locals-convention-camelCaseOnly exported tests css modules localsConvention with camelCaseOnly 1`] = ` Object { - "btnInfoIsDisabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", - "btnInfoIsDisabled1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", - "fooBar": "-a7200a43b5c2530b1414-foo_bar", - "simple": "-a7200a43b5c2530b1414-simple", + btnInfoIsDisabled: -a7200a43b5c2530b1414-btn-info_is-disabled, + btnInfoIsDisabled1: -a7200a43b5c2530b1414-btn--info_is-disabled_1, + fooBar: -a7200a43b5c2530b1414-foo_bar, + simple: -a7200a43b5c2530b1414-simple, } `; exports[`config config/builtins/css-modules-locals-convention-dashes exported tests css modules localsConvention with dashes 1`] = ` Object { - "btn--info_is-disabled_1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", - "btn-info-is-disabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", - "btn-info-is-disabled-1": "-a7200a43b5c2530b1414-btn--info_is-disabled_1", - "btn-info_is-disabled": "-a7200a43b5c2530b1414-btn-info_is-disabled", - "foo-bar": "-a7200a43b5c2530b1414-foo_bar", - "foo_bar": "-a7200a43b5c2530b1414-foo_bar", - "simple": "-a7200a43b5c2530b1414-simple", + btn--info_is-disabled_1: -a7200a43b5c2530b1414-btn--info_is-disabled_1, + btn-info-is-disabled: -a7200a43b5c2530b1414-btn-info_is-disabled, + btn-info-is-disabled-1: -a7200a43b5c2530b1414-btn--info_is-disabled_1, + btn-info_is-disabled: -a7200a43b5c2530b1414-btn-info_is-disabled, + foo-bar: -a7200a43b5c2530b1414-foo_bar, + foo_bar: -a7200a43b5c2530b1414-foo_bar, + simple: -a7200a43b5c2530b1414-simple, } `; exports[`config config/builtins/css-modules-pseudo exported tests css modules pseudo syntax 1`] = ` Object { - "bar": "-a7200a43b5c2530b1414-bar", - "bav": "-a7200a43b5c2530b1414-bav", - "foo": "-a7200a43b5c2530b1414-foo", - "four": "-a7200a43b5c2530b1414-four", - "one": "-a7200a43b5c2530b1414-one", - "three": "-a7200a43b5c2530b1414-three", - "two": "-a7200a43b5c2530b1414-two", + bar: -a7200a43b5c2530b1414-bar, + bav: -a7200a43b5c2530b1414-bav, + foo: -a7200a43b5c2530b1414-foo, + four: -a7200a43b5c2530b1414-four, + one: -a7200a43b5c2530b1414-one, + three: -a7200a43b5c2530b1414-three, + two: -a7200a43b5c2530b1414-two, } `; exports[`config config/builtins/css-modules-simple exported tests css modules simple test 1`] = ` Object { - "style": "-ca56f23580d7bbb484-style", + style: -ca56f23580d7bbb484-style, } `; exports[`config config/chunk-index/available-modules-order-index exported tests should compile 1`] = ` -".m { +.m { color: red; } .n { color: blue; } -head{--webpack--shared:&_547,Ā587;}" +head{--webpack--shared:&_547,Ā587;} `; exports[`config config/css/at-import-in-the-top exported tests at-import-in-the-top 1`] = ` -"@import url(\\"https://fonts.googleapis.com/css2?family=Roboto\\"); -@import url(\\"https://fonts.googleapis.com/css2?family=Inter\\"); +@import url("https://fonts.googleapis.com/css2?family=Roboto"); +@import url("https://fonts.googleapis.com/css2?family=Inter"); .c { color: pink; } @@ -244,11 +244,11 @@ exports[`config config/css/at-import-in-the-top exported tests at-import-in-the- color: red; } -head{--webpack--909:&_412,Ā645ą_34;}" +head{--webpack--909:&_412,Ā645ą_34;} `; exports[`config config/css/export-selector exported tests should have correct css result 1`] = ` -"/* #region \\"./style.module.css?imported\\" */ +/* #region "./style.module.css?imported" */ /* - type: css/auto */ @@ -259,27 +259,27 @@ exports[`config config/css/export-selector exported tests should have correct cs -/* #endregion \\"./style.module.css?imported\\" */ +/* #endregion "./style.module.css?imported" */ -head{--webpack--imported_js:foo:foo/bar:b\\\\ a\\\\ r/local:local/dashName:dashName/&\\\\.\\\\/style\\\\.module\\\\.css\\\\?imported;}" +head{--webpack--imported_js:foo:foo/bar:b/ a/ r/local:local/dashName:dashName/&/.//style/.module/.css/?imported;} `; -exports[`config config/css/rewrite-url exported tests should rewrite the css url() 1`] = `"5d8d67b36a3d70a5cea9.png"`; +exports[`config config/css/rewrite-url exported tests should rewrite the css url() 1`] = `5d8d67b36a3d70a5cea9.png`; -exports[`config config/css/rewrite-url exported tests should rewrite the css url() 2`] = `"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvf3sAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEWSURBVHgBjZFRSsNAEIb/3fQAOUK9gfpe6YIovjU3UE+gJ2g8gTcw3sC+itUFrW+BeAN7ATFSKAjbHWcSC+mSlszLDrvfzvzzj0LHmNpZBtBQd4Gf7fuYgHPPueoCe1DK1UsHd7Dzw+P0daQj/SC5h09OzdGktw221vZXUBlVMN0ILPd6O9yzBBXX8CBdv6kWOGa4YLivQJNjM0ia73oTLsBwJjCB5gu4i7CgbsIey5ThEcOfKziTGFOGHypJeZ7jZ/Gbst4x2/fN9h2eGTNvgk92VrDEWLNmfJXLpIYrRy5b4Fs+9v2/pL0oUncI7FuHLI6PK5lJZGoe8qXNvrry27DesoRLpLPmNkTw9yEcxPWJMR+S/AFbfpAZqxwUNQAAAABJRU5ErkJggg=="`; +exports[`config config/css/rewrite-url exported tests should rewrite the css url() 2`] = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAOCAYAAAAbvfXsAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEWSURBVHgBjZFRSsNAEIb/3fQAOUK9gfpe6YIovjU3UE+gJ2g8gTcwXsC+itUFrW+BeAN7ATFSKAjbHWcSC+mSlszLDrvfzvzzj0LHmNpZBtBQd4Gf7fuYgHPPueoCe1DK1UsHd7Dzw+P0daQj/SC5h09OzdGktw221vZXUBlVMN0ILPd6O9yzBBXX8CBdv6kWOGa4YLivQJNjM0ia73oTLsBwJjCB5gu4i7CgbsIey5ThEcOfKziTGFOGHypJeZ7jZ/Gbst4x2/fN9h2eGTNvgk92VrDEWLNmfJXLpIYrRy5b4Fs+9v2/pL0oUncI7FuHLI6PK5lJZGoe8qXNvrry27DesoRLpLPmNkTw9yEcxPWJMR+S/AFbfpAZqxwUNQAAAABJRU5ErkJggg==`; -exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 1`] = `"5d8d67b36a3d70a5cea9.png"`; +exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 1`] = `5d8d67b36a3d70a5cea9.png`; -exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 2`] = `"5d8d67b36a3d70a5cea9.png"`; +exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 2`] = `5d8d67b36a3d70a5cea9.png`; -exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath and ~@ prefix 1`] = `"/image/logo.5d8d67b3.png"`; +exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath and ~@ prefix 1`] = `/image/logo.5d8d67b3.png`; -exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath when output.cssFilename is set 1`] = `"/image/logo.5d8d67b3.png"`; +exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath when output.cssFilename is set 1`] = `/image/logo.5d8d67b3.png`; exports[`config config/css/urls exported tests css urls should works 1`] = ` -"/* @supports (background-image: url(\\"unknown.png\\")) { +/* @supports (background-image: url("unknown.png")) { div { - a195: url(\\"img.png\\"); + a195: url("img.png"); } } */ @@ -288,7 +288,7 @@ div { } div { - a14: url(\\"data:image/svg+xml;charset=utf-8,\\"); + a14: url("data:image/svg+xml;charset=utf-8,"); } div { @@ -296,11 +296,11 @@ div { } div { - a16: url('data:image/svg+xml;charset=utf-8,#filter'); + a16: url('data:image/svg+xml;charset=utf-8,#filter'); } div { - a17: url(\\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%20stdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter\\"); + a17: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%5C%22%3E%3Cfilter%20id%3D%5C%22filter%5C%22%3E%3CfeGaussianBlur%20in%3D%5C%22SourceAlpha%5C%22%XstdDeviation%3D%5C%220%5C%22%20%2F%3E%3CfeOffset%20dx%3D%5C%221%5C%22%20dy%3D%5C%222%5C%22%20result%3D%5C%22offsetblur%5C%22%20%2F%3E%3CfeFlood%20flood-color%3D%5C%22rgba(255%2C255%2C255%2C1)%5C%22%20%2F%3E%3CfeComposite%20in2%3D%5C%22offsetblur%5C%22%20operator%3D%5C%22in%5C%22%20%2F%3E%3CfeMerge%3E%3CfeMergeNode%20%2F%3E%3CfeMergeNode%20in%3D%5C%22SourceGraphic%5C%22%20%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fsvg%3E%23filter"); } div { @@ -312,11 +312,11 @@ div { } div { - a148: url('data:image/svg+xml,%3Csvg xmlns=\\"http://www.w3.org/2000/svg\\"%3E%3Crect width=\\"100%25\\" height=\\"100%25\\" style=\\"stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px\\" /%3E%3C/svg%3E'); - a149: url('data:image/svg+xml,%3Csvg xmlns=\\"http://www.w3.org/2000/svg\\"%3E%3Crect width=\\"100%25\\" height=\\"100%25\\" style=\\"stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px\\" /%3E%3C/svg%3E'); - a150: url('data:image/svg+xml,%3Csvg xmlns=\\"http://www.w3.org/2000/svg\\"%3E%3Crect width=\\"100%25\\" height=\\"100%25\\" style=\\"stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px\\" /%3E%3C/svg%3E'); - a151: url('data:image/svg+xml;utf8,'); - a152: url('data:image/svg+xml;utf8,'); + a148: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="100%25" height="100%25" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /%3E%3C/svg%3E'); + a149: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="100%25" height="100%25" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /%3E%3C/svg%3E'); + a150: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="100%25" height="100%25" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /%3E%3C/svg%3E'); + a151: url('data:image/svg+xml;utf8,'); + a152: url('data:image/svg+xml;utf8,'); } div { @@ -325,16 +325,16 @@ div { } div { - a143: url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%0A%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%22191px%22%20height%3D%22191px%22%20viewBox%3D%220%200%20191%20191%22%20enable-background%3D%22new%200%200%20191%20191%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M95.5%2C0C42.8%2C0%2C0%2C42.8%2C0%2C95.5S42.8%2C191%2C95.5%2C191S191%2C148.2%2C191%2C95.5S148.2%2C0%2C95.5%2C0z%20M95.5%2C187.6%0A%09c-50.848%2C0-92.1-41.25-92.1-92.1c0-50.848%2C41.252-92.1%2C92.1-92.1c50.85%2C0%2C92.1%2C41.252%2C92.1%2C92.1%0A%09C187.6%2C146.35%2C146.35%2C187.6%2C95.5%2C187.6z%22%2F%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M92.9%2C10v8.6H91v-6.5c-0.1%2C0.1-0.2%2C0.2-0.4%2C0.3c-0.2%2C0.1-0.3%2C0.2-0.4%2C0.2c-0.1%2C0-0.3%2C0.1-0.5%2C0.2%0A%09%09c-0.2%2C0.1-0.3%2C0.1-0.5%2C0.1v-1.6c0.5-0.1%2C0.9-0.3%2C1.4-0.5c0.5-0.2%2C0.8-0.5%2C1.2-0.7h1.1V10z%22%2F%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M97.1%2C17.1h3.602v1.5h-5.6V18c0-0.4%2C0.1-0.8%2C0.2-1.2c0.1-0.4%2C0.3-0.6%2C0.5-0.9c0.2-0.3%2C0.5-0.5%2C0.7-0.7%0A%09%09c0.2-0.2%2C0.5-0.4%2C0.7-0.6c0.199-0.2%2C0.5-0.3%2C0.6-0.5c0.102-0.2%2C0.301-0.3%2C0.5-0.5c0.2-0.2%2C0.2-0.3%2C0.301-0.5%0A%09%09c0.101-0.2%2C0.101-0.3%2C0.101-0.5c0-0.4-0.101-0.6-0.3-0.8c-0.2-0.2-0.4-0.3-0.801-0.3c-0.699%2C0-1.399%2C0.3-2.101%2C0.9v-1.6%0A%09%09c0.7-0.5%2C1.5-0.7%2C2.5-0.7c0.399%2C0%2C0.8%2C0.1%2C1.101%2C0.2c0.301%2C0.1%2C0.601%2C0.3%2C0.899%2C0.5c0.3%2C0.2%2C0.399%2C0.5%2C0.5%2C0.8%0A%09%09c0.101%2C0.3%2C0.2%2C0.6%2C0.2%2C1s-0.102%2C0.7-0.2%2C1c-0.099%2C0.3-0.3%2C0.6-0.5%2C0.8c-0.2%2C0.2-0.399%2C0.5-0.7%2C0.7c-0.3%2C0.2-0.5%2C0.4-0.8%2C0.6%0A%09%09c-0.2%2C0.1-0.399%2C0.3-0.5%2C0.4s-0.3%2C0.3-0.5%2C0.4s-0.2%2C0.3-0.3%2C0.4C97.1%2C17%2C97.1%2C17%2C97.1%2C17.1z%22%2F%3E%0A%3C%2Fg%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M15%2C95.4c0%2C0.7-0.1%2C1.4-0.2%2C2c-0.1%2C0.6-0.4%2C1.1-0.7%2C1.5C13.8%2C99.3%2C13.4%2C99.6%2C12.9%2C99.8s-1%2C0.3-1.5%2C0.3%0A%09%09c-0.7%2C0-1.3-0.1-1.8-0.3v-1.5c0.4%2C0.3%2C1%2C0.4%2C1.6%2C0.4c0.6%2C0%2C1.1-0.2%2C1.5-0.7c0.4-0.5%2C0.5-1.1%2C0.5-1.9l0%2C0%0A%09%09C12.8%2C96.7%2C12.3%2C96.9%2C11.5%2C96.9c-0.3%2C0-0.7-0.102-1-0.2c-0.3-0.101-0.5-0.3-0.8-0.5c-0.3-0.2-0.4-0.5-0.5-0.8%0A%09%09c-0.1-0.3-0.2-0.7-0.2-1c0-0.4%2C0.1-0.8%2C0.2-1.2c0.1-0.4%2C0.3-0.7%2C0.6-0.9c0.3-0.2%2C0.6-0.5%2C0.9-0.6c0.3-0.1%2C0.8-0.2%2C1.2-0.2%0A%09%09c0.5%2C0%2C0.9%2C0.1%2C1.2%2C0.3c0.3%2C0.2%2C0.7%2C0.4%2C0.9%2C0.8s0.5%2C0.7%2C0.6%2C1.2S15%2C94.8%2C15%2C95.4z%20M13.1%2C94.4c0-0.2%2C0-0.4-0.1-0.6%0A%09%09c-0.1-0.2-0.1-0.4-0.2-0.5c-0.1-0.1-0.2-0.2-0.4-0.3c-0.2-0.1-0.3-0.1-0.5-0.1c-0.2%2C0-0.3%2C0-0.4%2C0.1s-0.3%2C0.2-0.3%2C0.3%0A%09%09c0%2C0.1-0.2%2C0.3-0.2%2C0.4c0%2C0.1-0.1%2C0.4-0.1%2C0.6c0%2C0.2%2C0%2C0.4%2C0.1%2C0.6c0.1%2C0.2%2C0.1%2C0.3%2C0.2%2C0.4c0.1%2C0.1%2C0.2%2C0.2%2C0.4%2C0.3%0A%09%09c0.2%2C0.1%2C0.3%2C0.1%2C0.5%2C0.1c0.2%2C0%2C0.3%2C0%2C0.4-0.1s0.2-0.2%2C0.3-0.3c0.1-0.1%2C0.2-0.2%2C0.2-0.4C13%2C94.7%2C13.1%2C94.6%2C13.1%2C94.4z%22%2F%3E%0A%3C%2Fg%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M176%2C99.7V98.1c0.6%2C0.4%2C1.2%2C0.602%2C2%2C0.602c0.5%2C0%2C0.8-0.102%2C1.1-0.301c0.301-0.199%2C0.4-0.5%2C0.4-0.801%0A%09%09c0-0.398-0.2-0.699-0.5-0.898c-0.3-0.2-0.8-0.301-1.3-0.301h-0.802V95h0.701c1.101%2C0%2C1.601-0.4%2C1.601-1.1c0-0.7-0.4-1-1.302-1%0A%09%09c-0.6%2C0-1.1%2C0.2-1.6%2C0.5v-1.5c0.6-0.3%2C1.301-0.4%2C2.1-0.4c0.9%2C0%2C1.5%2C0.2%2C2%2C0.6s0.701%2C0.9%2C0.701%2C1.5c0%2C1.1-0.601%2C1.8-1.701%2C2.1l0%2C0%0A%09%09c0.602%2C0.1%2C1.102%2C0.3%2C1.4%2C0.6s0.5%2C0.8%2C0.5%2C1.3c0%2C0.801-0.3%2C1.4-0.9%2C1.9c-0.6%2C0.5-1.398%2C0.7-2.398%2C0.7%0A%09%09C177.2%2C100.1%2C176.5%2C100%2C176%2C99.7z%22%2F%3E%0A%3C%2Fg%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M98.5%2C179.102c0%2C0.398-0.1%2C0.799-0.2%2C1.199C98.2%2C180.7%2C98%2C181%2C97.7%2C181.2s-0.601%2C0.5-0.9%2C0.601%0A%09%09c-0.3%2C0.1-0.7%2C0.199-1.2%2C0.199c-0.5%2C0-0.9-0.1-1.3-0.3c-0.4-0.2-0.7-0.399-0.9-0.8c-0.2-0.4-0.5-0.7-0.6-1.2%0A%09%09c-0.1-0.5-0.2-1-0.2-1.601c0-0.699%2C0.1-1.399%2C0.3-2c0.2-0.601%2C0.4-1.101%2C0.8-1.5c0.4-0.399%2C0.7-0.699%2C1.2-1c0.5-0.3%2C1-0.3%2C1.6-0.3%0A%09%09c0.6%2C0%2C1.2%2C0.101%2C1.5%2C0.199v1.5c-0.4-0.199-0.9-0.399-1.4-0.399c-0.3%2C0-0.6%2C0.101-0.8%2C0.2c-0.2%2C0.101-0.5%2C0.3-0.7%2C0.5%0A%09%09c-0.2%2C0.199-0.3%2C0.5-0.4%2C0.8c-0.1%2C0.301-0.2%2C0.7-0.2%2C1.101l0%2C0c0.4-0.601%2C1-0.8%2C1.8-0.8c0.3%2C0%2C0.7%2C0.1%2C0.9%2C0.199%0A%09%09c0.2%2C0.101%2C0.5%2C0.301%2C0.7%2C0.5c0.199%2C0.2%2C0.398%2C0.5%2C0.5%2C0.801C98.5%2C178.2%2C98.5%2C178.7%2C98.5%2C179.102z%20M96.7%2C179.2%0A%09%09c0-0.899-0.4-1.399-1.1-1.399c-0.2%2C0-0.3%2C0-0.5%2C0.1c-0.2%2C0.101-0.3%2C0.201-0.4%2C0.301c-0.1%2C0.101-0.2%2C0.199-0.2%2C0.4%0A%09%09c0%2C0.199-0.1%2C0.299-0.1%2C0.5c0%2C0.199%2C0%2C0.398%2C0.1%2C0.6s0.1%2C0.3%2C0.2%2C0.5c0.1%2C0.199%2C0.2%2C0.199%2C0.4%2C0.3c0.2%2C0.101%2C0.3%2C0.101%2C0.5%2C0.101%0A%09%09c0.2%2C0%2C0.3%2C0%2C0.5-0.101c0.2-0.101%2C0.301-0.199%2C0.301-0.3c0-0.1%2C0.199-0.301%2C0.199-0.399C96.6%2C179.7%2C96.7%2C179.4%2C96.7%2C179.2z%22%2F%3E%0A%3C%2Fg%3E%0A%3Ccircle%20fill%3D%22%23636363%22%20cx%3D%2295%22%20cy%3D%2295%22%20r%3D%227%22%2F%3E%0A%3C%2Fsvg%3E%0A) + a143: url(data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3C!DOCTYPE%Xsvg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%0A%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%22191px%22%20height%3D%22191px%22%20viewBox%3D%220%200%20191%20191%22%20enable-background%3D%22new%200%200%20191%20191%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M95.5%2C0C42.8%2C0%2C0%2C42.8%2C0%2C95.5S42.8%2C191%2C95.5%2C191S191%2C148.2%2C191%2C95.5S148.2%2C0%2C95.5%2C0z%20M95.5%2C187.6%0A%09c-50.848%2C0-92.1-41.25-92.1-92.1c0-50.848%2C41.252-92.1%2C92.1-92.1c50.85%2C0%2C92.1%2C41.252%2C92.1%2C92.1%0A%09C187.6%2C146.35%2C146.35%2C187.6%2C95.5%2C187.6z%22%2F%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M92.9%2C10v8.6H91v-6.5c-0.1%2C0.1-0.2%2C0.2-0.4%2C0.3c-0.2%2C0.1-0.3%2C0.2-0.4%2C0.2c-0.1%2C0-0.3%2C0.1-0.5%2C0.2%0A%09%09c-0.2%2C0.1-0.3%2C0.1-0.5%2C0.1v-1.6c0.5-0.1%2C0.9-0.3%2C1.4-0.5c0.5-0.2%2C0.8-0.5%2C1.2-0.7h1.1V10z%22%2F%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M97.1%2C17.1h3.602v1.5h-5.6V18c0-0.4%2C0.1-0.8%2C0.2-1.2c0.1-0.4%2C0.3-0.6%2C0.5-0.9c0.2-0.3%2C0.5-0.5%2C0.7-0.7%0A%09%09c0.2-0.2%2C0.5-0.4%2C0.7-0.6c0.199-0.2%2C0.5-0.3%2C0.6-0.5c0.102-0.2%2C0.301-0.3%2C0.5-0.5c0.2-0.2%2C0.2-0.3%2C0.301-0.5%0A%09%09c0.101-0.2%2C0.101-0.3%2C0.101-0.5c0-0.4-0.101-0.6-0.3-0.8c-0.2-0.2-0.4-0.3-0.801-0.3c-0.699%2C0-1.399%2C0.3-2.101%2C0.9v-1.6%0A%09%09c0.7-0.5%2C1.5-0.7%2C2.5-0.7c0.399%2C0%2C0.8%2C0.1%2C1.101%2C0.2c0.301%2C0.1%2C0.601%2C0.3%2C0.899%2C0.5c0.3%2C0.2%2C0.399%2C0.5%2C0.5%2C0.8%0A%09%09c0.101%2C0.3%2C0.2%2C0.6%2C0.2%2CXs-0.102%2C0.7-0.2%2C1c-0.099%2C0.3-0.3%2C0.6-0.5%2C0.8c-0.2%2C0.2-0.399%2C0.5-0.7%2C0.7c-0.3%2C0.2-0.5%2C0.4-0.8%2C0.6%0A%09%09c-0.2%2C0.1-0.399%2C0.3-0.5%2CXs-0.3%2C0.3-0.5%2CXs-0.2%2C0.3-0.3%2C0.4C97.1%2C17%2C97.1%2C17%2C97.1%2C17.1z%22%2F%3E%0A%3C%2Fg%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M15%2C95.4c0%2C0.7-0.1%2C1.4-0.2%2C2c-0.1%2C0.6-0.4%2C1.1-0.7%2C1.5C13.8%2C99.3%2C13.4%2C99.6%2C12.9%2CXs-1%2C0.3-1.5%2C0.3%0A%09%09c-0.7%2C0-1.3-0.1-1.8-0.3v-1.5c0.4%2C0.3%2C1%2C0.4%2C1.6%2C0.4c0.6%2C0%2C1.1-0.2%2C1.5-0.7c0.4-0.5%2C0.5-1.1%2C0.5-1.9l0%2C0%0A%09%09C12.8%2C96.7%2C12.3%2C96.9%2C11.5%2C96.9c-0.3%2C0-0.7-0.102-1-0.2c-0.3-0.101-0.5-0.3-0.8-0.5c-0.3-0.2-0.4-0.5-0.5-0.8%0A%09%09c-0.1-0.3-0.2-0.7-0.2-1c0-0.4%2C0.1-0.8%2C0.2-1.2c0.1-0.4%2C0.3-0.7%2C0.6-0.9c0.3-0.2%2C0.6-0.5%2C0.9-0.6c0.3-0.1%2C0.8-0.2%2C1.2-0.2%0A%09%09c0.5%2C0%2C0.9%2C0.1%2C1.2%2C0.3c0.3%2C0.2%2C0.7%2C0.4%2C0.9%2CXs0.5%2C0.7%2C0.6%2C1.2S15%2C94.8%2C15%2C95.4z%20M13.1%2C94.4c0-0.2%2C0-0.4-0.1-0.6%0A%09%09c-0.1-0.2-0.1-0.4-0.2-0.5c-0.1-0.1-0.2-0.2-0.4-0.3c-0.2-0.1-0.3-0.1-0.5-0.1c-0.2%2C0-0.3%2C0-0.4%2CXs-0.3%2C0.2-0.3%2C0.3%0A%09%09c0%2C0.1-0.2%2C0.3-0.2%2C0.4c0%2C0.1-0.1%2C0.4-0.1%2C0.6c0%2C0.2%2C0%2C0.4%2C0.1%2C0.6c0.1%2C0.2%2C0.1%2C0.3%2C0.2%2C0.4c0.1%2C0.1%2C0.2%2C0.2%2C0.4%2C0.3%0A%09%09c0.2%2C0.1%2C0.3%2C0.1%2C0.5%2C0.1c0.2%2C0%2C0.3%2C0%2C0.4-Xs0.2-0.2%2C0.3-0.3c0.1-0.1%2C0.2-0.2%2C0.2-0.4C13%2C94.7%2C13.1%2C94.6%2C13.1%2C94.4z%22%2F%3E%0A%3C%2Fg%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M176%2C99.7V98.1c0.6%2C0.4%2C1.2%2C0.602%2C2%2C0.602c0.5%2C0%2C0.8-0.102%2C1.1-0.301c0.301-0.199%2C0.4-0.5%2C0.4-0.801%0A%09%09c0-0.398-0.2-0.699-0.5-0.898c-0.3-0.2-0.8-0.301-1.3-0.301h-0.802V95h0.701c1.101%2C0%2C1.601-0.4%2C1.601-1.1c0-0.7-0.4-1-1.302-1%0A%09%09c-0.6%2C0-1.1%2C0.2-1.6%2C0.5v-1.5c0.6-0.3%2C1.301-0.4%2C2.1-0.4c0.9%2C0%2C1.5%2C0.2%2C2%2CXs0.701%2C0.9%2C0.701%2C1.5c0%2C1.1-0.601%2C1.8-1.701%2C2.1l0%2C0%0A%09%09c0.602%2C0.1%2C1.102%2C0.3%2C1.4%2CXs0.5%2C0.8%2C0.5%2C1.3c0%2C0.801-0.3%2C1.4-0.9%2C1.9c-0.6%2C0.5-1.398%2C0.7-2.398%2C0.7%0A%09%09C177.2%2C100.1%2C176.5%2C100%2C176%2C99.7z%22%2F%3E%0A%3C%2Fg%3E%0A%3Cg%3E%0A%09%3Cpath%20fill%3D%22%23636363%22%20d%3D%22M98.5%2C179.102c0%2C0.398-0.1%2C0.799-0.2%2C1.199C98.2%2C180.7%2C98%2C181%2C97.7%2CXs-0.601%2C0.5-0.9%2C0.601%0A%09%09c-0.3%2C0.1-0.7%2C0.199-1.2%2C0.199c-0.5%2C0-0.9-0.1-1.3-0.3c-0.4-0.2-0.7-0.399-0.9-0.8c-0.2-0.4-0.5-0.7-0.6-1.2%0A%09%09c-0.1-0.5-0.2-1-0.2-1.601c0-0.699%2C0.1-1.399%2C0.3-2c0.2-0.601%2C0.4-1.101%2C0.8-1.5c0.4-0.399%2C0.7-0.699%2C1.2-1c0.5-0.3%2C1-0.3%2C1.6-0.3%0A%09%09c0.6%2C0%2C1.2%2C0.101%2C1.5%2C0.199v1.5c-0.4-0.199-0.9-0.399-1.4-0.399c-0.3%2C0-0.6%2C0.101-0.8%2C0.2c-0.2%2C0.101-0.5%2C0.3-0.7%2C0.5%0A%09%09c-0.2%2C0.199-0.3%2C0.5-0.4%2C0.8c-0.1%2C0.301-0.2%2C0.7-0.2%2C1.101l0%2C0c0.4-0.601%2C1-0.8%2C1.8-0.8c0.3%2C0%2C0.7%2C0.1%2C0.9%2C0.199%0A%09%09c0.2%2C0.101%2C0.5%2C0.301%2C0.7%2C0.5c0.199%2C0.2%2C0.398%2C0.5%2C0.5%2C0.801C98.5%2C178.2%2C98.5%2C178.7%2C98.5%2C179.102z%20M96.7%2C179.2%0A%09%09c0-0.899-0.4-1.399-1.1-1.399c-0.2%2C0-0.3%2C0-0.5%2C0.1c-0.2%2C0.101-0.3%2C0.201-0.4%2C0.301c-0.1%2C0.101-0.2%2C0.199-0.2%2C0.4%0A%09%09c0%2C0.199-0.1%2C0.299-0.1%2C0.5c0%2C0.199%2C0%2C0.398%2C0.1%2CXs0.1%2C0.3%2C0.2%2C0.5c0.1%2C0.199%2C0.2%2C0.199%2C0.4%2C0.3c0.2%2C0.101%2C0.3%2C0.101%2C0.5%2C0.101%0A%09%09c0.2%2C0%2C0.3%2C0%2C0.5-0.101c0.2-0.101%2C0.301-0.199%2C0.301-0.3c0-0.1%2C0.199-0.301%2C0.199-0.399C96.6%2C179.7%2C96.7%2C179.4%2C96.7%2C179.2z%22%2F%3E%0A%3C%2Fg%3E%0A%3Ccircle%20fill%3D%22%23636363%22%20cx%3D%2295%22%20cy%3D%2295%22%20r%3D%227%22%2F%3E%0A%3C%2Fsvg%3E%0A) 50% 50%/191px no-repeat; } -head{--webpack--120:&_13;}" +head{--webpack--120:&_13;} `; exports[`config config/library/modern-module-force-concaten step should pass: .cjs should bail out 1`] = ` -"var __webpack_modules__ = ({ -\\"851\\": (function (module) { +var __webpack_modules__ = ({ +"851": (function (module) { module.exports = 'b' }), @@ -368,13 +368,12 @@ return module.exports; // startup // Load entry module and return exports // This entry module is referenced by other modules so it can't be inlined -var __webpack_exports__ = __webpack_require__(\\"851\\"); -" +var __webpack_exports__ = __webpack_require__("851"); `; exports[`config config/library/modern-module-force-concaten step should pass: .cjs should bail out when bundling 1`] = ` -"var __webpack_modules__ = ({ -\\"997\\": (function (module) { +var __webpack_modules__ = ({ +"997": (function (module) { module.exports = 'bar' }), @@ -443,7 +442,7 @@ __webpack_require__.o = function (obj, prop) { const foo = 'foo' // EXTERNAL MODULE: ./e/bar.cjs -var bar = __webpack_require__(\\"997\\"); +var bar = __webpack_require__("997"); var bar_default = /*#__PURE__*/__webpack_require__.n(bar); ;// CONCATENATED MODULE: ./e/index.js @@ -453,27 +452,24 @@ var bar_default = /*#__PURE__*/__webpack_require__.n(bar); var __webpack_exports__bar = (bar_default()); export { foo, __webpack_exports__bar as bar }; -" `; exports[`config config/library/modern-module-force-concaten step should pass: .mjs should concat 1`] = ` -" ;// CONCATENATED MODULE: ./d.mjs const d = 'd' -" `; exports[`config config/library/modern-module-force-concaten step should pass: external module should bail out when bundling 1`] = ` -"import { createRequire as __WEBPACK_EXTERNAL_createRequire } from \\"module\\"; +import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; var __webpack_modules__ = ({ -\\"17\\": (function (module) { -module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\\"path\\"); +"17": (function (module) { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); }), -\\"441\\": (function (module, __unused_webpack_exports, __webpack_require__) { +"441": (function (module, __unused_webpack_exports, __webpack_require__) { const path = __webpack_require__(17) -module.exports = path.sep +module.exports = pathXsep }), @@ -539,7 +535,7 @@ __webpack_require__.o = function (obj, prop) { /************************************************************************/ // EXTERNAL MODULE: ./f/bar.cjs -var bar = __webpack_require__(\\"441\\"); +var bar = __webpack_require__("441"); var bar_default = /*#__PURE__*/__webpack_require__.n(bar); ;// CONCATENATED MODULE: ./f/foo.js const foo = 'foo' @@ -553,28 +549,21 @@ const value = foo + (bar_default()) export { value }; -" `; exports[`config config/library/modern-module-force-concaten step should pass: harmony export should concat 1`] = ` -" ;// CONCATENATED MODULE: ./a.js const a = 'a' export { a }; -" `; -exports[`config config/library/modern-module-force-concaten step should pass: unambiguous should bail out 1`] = ` -"const c = 'c' - -" -`; +exports[`config config/library/modern-module-force-concaten step should pass: unambiguous should bail out 1`] = `const c = 'c'`; -exports[`config config/optimization/minimizer-esm-asset exported tests minimizing an asset file of esm type should success 1`] = `"console.log(import.meta.url);export const a=1;"`; +exports[`config config/optimization/minimizer-esm-asset exported tests minimizing an asset file of esm type should success 1`] = `console.log(import.meta.url);export const a=1;`; exports[`config config/optimization/minimizer-swc-extract-comments exported tests should keep the extracted license file stable 1`] = ` -"/** +/** * bar * @license MIT */ @@ -592,40 +581,40 @@ exports[`config config/optimization/minimizer-swc-extract-comments exported test /** * relative * @license MIT - */" + */ `; exports[`config config/plugins/chunk-modules exported tests chunk-modules 1`] = ` Object { - "515": Object { - "entryModules": Array [], - "modules": Array [ + 515: Object { + entryModules: Array [], + modules: Array [ Object { - "context": "", - "identifier": "/async.js", - "resource": "/async.js", + context: , + identifier: /async.js, + resource: /async.js, }, ], }, - "909": Object { - "entryModules": Array [ + 909: Object { + entryModules: Array [ Object { - "context": "", - "identifier": "/index.js", - "resource": "/index.js", + context: , + identifier: /index.js, + resource: /index.js, }, ], - "modules": Array [ + modules: Array [ Object { - "context": "", - "identifier": "/index.js", - "resource": "/index.js", + context: , + identifier: /index.js, + resource: /index.js, }, Object { - "identifier": "external node-commonjs \\"fs\\"", + identifier: external node-commonjs "fs", }, Object { - "identifier": "external node-commonjs \\"path\\"", + identifier: external node-commonjs "path", }, ], }, @@ -633,13 +622,13 @@ Object { `; exports[`config config/schemes/data-imports exported tests data imports 1`] = ` -".red{color: red;} +.red{color: red;} .b{color: green} .a { color: palegreen; };;; .bad { a: url(data:text/bad-base64;base64,abcd?#iefix); - b: url(\\"data:text/bad-base64;base64, abcd?#iefix\\"); + b: url("data:text/bad-base64;base64, abcd?#iefix"); } /* .b{color: green} */ @@ -647,11 +636,11 @@ exports[`config config/schemes/data-imports exported tests data imports 1`] = ` .class { - a: url(26a611d6d05cbb01e459.svg); - b: url(26a611d6d05cbb01e459.svg); + a: url(26a611d6d05cbb01eXsvg); + b: url(26a611d6d05cbb01eXsvg); c: url(26a611d6d05cbb01e459); d: url(26a611d6d05cbb01e459); } -head{--webpack--909:&_653,Ā47ĄĀ645ą_49Ď571;}" +head{--webpack--909:&_653,Ā47ĄĀ645ą_49Ď571;} `; diff --git a/packages/rspack-test-tools/tests/__snapshots__/Defaults.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/Defaults.test.js.snap index 13aa4687c17..800f99f961c 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/Defaults.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/Defaults.test.js.snap @@ -2,483 +2,483 @@ exports[`Base Defaults Snapshot should have the correct base config 1`] = ` Object { - "bail": false, - "cache": false, - "context": "", - "dependencies": undefined, - "devServer": undefined, - "devtool": false, - "entry": Object { - "main": Object { - "import": Array [ - "./src", + bail: false, + cache: false, + context: , + dependencies: undefined, + devServer: undefined, + devtool: false, + entry: Object { + main: Object { + import: Array [ + ./src, ], }, }, - "experiments": Object { - "asyncWebAssembly": false, - "css": undefined, - "futureDefaults": false, - "incremental": Object { - "collectModulesDiagnostics": false, - "emitAssets": true, - "inferAsyncModules": false, - "make": true, - "moduleCodegen": false, - "moduleHashes": false, - "moduleRuntimeRequirements": false, - "providedExports": false, + experiments: Object { + asyncWebAssembly: false, + css: undefined, + futureDefaults: false, + incremental: Object { + collectModulesDiagnostics: false, + emitAssets: true, + inferAsyncModules: false, + make: true, + moduleCodegen: false, + moduleHashes: false, + moduleRuntimeRequirements: false, + providedExports: false, }, - "layers": false, - "lazyCompilation": false, - "rspackFuture": Object { - "bundlerInfo": Object { - "bundler": "rspack", - "force": true, - "version": "$version$", + layers: false, + lazyCompilation: false, + rspackFuture: Object { + bundlerInfo: Object { + bundler: rspack, + force: true, + version: $version$, }, }, - "topLevelAwait": true, + topLevelAwait: true, }, - "externals": undefined, - "externalsPresets": Object { - "electron": false, - "electronMain": false, - "electronPreload": false, - "electronRenderer": false, - "node": false, - "nwjs": false, - "web": true, + externals: undefined, + externalsPresets: Object { + electron: false, + electronMain: false, + electronPreload: false, + electronRenderer: false, + node: false, + nwjs: false, + web: true, }, - "externalsType": "var", - "ignoreWarnings": undefined, - "infrastructureLogging": Object {}, - "loader": Object { - "environment": Object { - "arrowFunction": true, - "asyncFunction": true, - "bigIntLiteral": true, - "const": true, - "destructuring": true, - "document": true, - "dynamicImport": undefined, - "dynamicImportInWorker": undefined, - "forOf": true, - "globalThis": undefined, - "module": undefined, - "nodePrefixForCoreModules": true, - "optionalChaining": true, - "templateLiteral": true, + externalsType: var, + ignoreWarnings: undefined, + infrastructureLogging: Object {}, + loader: Object { + environment: Object { + arrowFunction: true, + asyncFunction: true, + bigIntLiteral: true, + const: true, + destructuring: true, + document: true, + dynamicImport: undefined, + dynamicImportInWorker: undefined, + forOf: true, + globalThis: undefined, + module: undefined, + nodePrefixForCoreModules: true, + optionalChaining: true, + templateLiteral: true, }, - "target": "web", + target: web, }, - "mode": "none", - "module": Object { - "defaultRules": Array [ + mode: none, + module: Object { + defaultRules: Array [ Object { - "mimetype": "application/node", - "type": "javascript/auto", + mimetype: application/node, + type: javascript/auto, }, Object { - "test": /\\\\\\.json\\$/i, - "type": "json", + test: /\\\\\\.json\\$/i, + type: json, }, Object { - "mimetype": "application/json", - "type": "json", + mimetype: application/json, + type: json, }, Object { - "resolve": Object { - "byDependency": Object { - "esm": Object { - "fullySpecified": true, + resolve: Object { + byDependency: Object { + esm: Object { + fullySpecified: true, }, }, }, - "test": /\\\\\\.mjs\\$/i, - "type": "javascript/esm", + test: /\\\\\\.mjs\\$/i, + type: javascript/esm, }, Object { - "descriptionData": Object { - "type": "module", + descriptionData: Object { + type: module, }, - "resolve": Object { - "byDependency": Object { - "esm": Object { - "fullySpecified": true, + resolve: Object { + byDependency: Object { + esm: Object { + fullySpecified: true, }, }, }, - "test": /\\\\\\.js\\$/i, - "type": "javascript/esm", + test: /\\\\\\.js\\$/i, + type: javascript/esm, }, Object { - "test": /\\\\\\.cjs\\$/i, - "type": "javascript/dynamic", + test: /\\\\\\.cjs\\$/i, + type: javascript/dynamic, }, Object { - "descriptionData": Object { - "type": "commonjs", + descriptionData: Object { + type: commonjs, }, - "test": /\\\\\\.js\\$/i, - "type": "javascript/dynamic", + test: /\\\\\\.js\\$/i, + type: javascript/dynamic, }, Object { - "mimetype": Object { - "or": Array [ - "text/javascript", - "application/javascript", + mimetype: Object { + or: Array [ + text/javascript, + application/javascript, ], }, - "resolve": Object { - "byDependency": Object { - "esm": Object { - "fullySpecified": true, + resolve: Object { + byDependency: Object { + esm: Object { + fullySpecified: true, }, }, }, - "type": "javascript/esm", + type: javascript/esm, }, Object { - "dependency": "url", - "oneOf": Array [ + dependency: url, + oneOf: Array [ Object { - "scheme": /\\^data\\$/, - "type": "asset/inline", + scheme: /\\^data\\$/, + type: asset/inline, }, Object { - "type": "asset/resource", + type: asset/resource, }, ], }, Object { - "type": "json", - "with": Object { - "type": "json", + type: json, + with: Object { + type: json, }, }, ], - "generator": Object {}, - "noParse": undefined, - "parser": Object { - "asset": Object { - "dataUrlCondition": Object { - "maxSize": 8096, + generator: Object {}, + noParse: undefined, + parser: Object { + asset: Object { + dataUrlCondition: Object { + maxSize: 8096, }, }, - "javascript": Object { - "dynamicImportMode": "lazy", - "dynamicImportPrefetch": false, - "dynamicImportPreload": false, - "exprContextCritical": true, - "importDynamic": true, - "importMeta": true, - "requireAsExpression": true, - "requireDynamic": true, - "requireResolve": true, - "strictExportPresence": false, - "url": true, - "worker": Array [ - "...", + javascript: Object { + dynamicImportMode: lazy, + dynamicImportPrefetch: false, + dynamicImportPreload: false, + exprContextCritical: true, + importDynamic: true, + importMeta: true, + requireAsExpression: true, + requireDynamic: true, + requireResolve: true, + strictExportPresence: false, + url: true, + worker: Array [ + ..., ], - "wrappedContextCritical": false, + wrappedContextCritical: false, }, }, - "rules": Array [], + rules: Array [], }, - "name": undefined, - "node": Object { - "__dirname": "warn-mock", - "__filename": "warn-mock", - "global": "warn", + name: undefined, + node: Object { + __dirname: warn-mock, + __filename: warn-mock, + global: warn, }, - "optimization": Object { - "chunkIds": "natural", - "concatenateModules": false, - "emitOnErrors": true, - "innerGraph": false, - "mangleExports": false, - "mergeDuplicateChunks": true, - "minimize": false, - "minimizer": Array [ + optimization: Object { + chunkIds: natural, + concatenateModules: false, + emitOnErrors: true, + innerGraph: false, + mangleExports: false, + mergeDuplicateChunks: true, + minimize: false, + minimizer: Array [ SwcJsMinimizerRspackPlugin { - "_args": Array [], - "affectedHooks": "compilation", - "name": "SwcJsMinimizerRspackPlugin", + _args: Array [], + affectedHooks: compilation, + name: SwcJsMinimizerRspackPlugin, }, LightningCssMinimizerRspackPlugin { - "_args": Array [], - "affectedHooks": undefined, - "name": "LightningCssMinimizerRspackPlugin", + _args: Array [], + affectedHooks: undefined, + name: LightningCssMinimizerRspackPlugin, }, ], - "moduleIds": "natural", - "nodeEnv": false, - "providedExports": true, - "realContentHash": false, - "removeAvailableModules": false, - "removeEmptyChunks": true, - "runtimeChunk": false, - "sideEffects": "flag", - "splitChunks": Object { - "automaticNameDelimiter": "-", - "cacheGroups": Object { - "default": Object { - "idHint": "", - "minChunks": 2, - "priority": -20, - "reuseExistingChunk": true, + moduleIds: natural, + nodeEnv: false, + providedExports: true, + realContentHash: false, + removeAvailableModules: false, + removeEmptyChunks: true, + runtimeChunk: false, + sideEffects: flag, + splitChunks: Object { + automaticNameDelimiter: -, + cacheGroups: Object { + default: Object { + idHint: , + minChunks: 2, + priority: -20, + reuseExistingChunk: true, }, - "defaultVendors": Object { - "idHint": "vendors", - "priority": -10, - "reuseExistingChunk": true, - "test": /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/i, + defaultVendors: Object { + idHint: vendors, + priority: -10, + reuseExistingChunk: true, + test: /\\[\\\\\\\\/\\]node_modules\\[\\\\\\\\/\\]/i, }, }, - "chunks": "async", - "defaultSizeTypes": Array [ - "javascript", - "unknown", + chunks: async, + defaultSizeTypes: Array [ + javascript, + unknown, ], - "hidePathInfo": false, - "maxAsyncRequests": Infinity, - "maxInitialRequests": Infinity, - "minChunks": 1, - "minSize": 10000, - "usedExports": false, + hidePathInfo: false, + maxAsyncRequests: Infinity, + maxInitialRequests: Infinity, + minChunks: 1, + minSize: 10000, + usedExports: false, }, - "usedExports": false, + usedExports: false, }, - "output": Object { - "assetModuleFilename": "[hash][ext][query]", - "asyncChunks": true, - "charset": true, - "chunkFilename": "[name].js", - "chunkFormat": "array-push", - "chunkLoadTimeout": 120000, - "chunkLoading": "jsonp", - "chunkLoadingGlobal": "webpackChunk_rspack_test_tools", - "clean": false, - "crossOriginLoading": false, - "cssChunkFilename": "[name].css", - "cssFilename": "[name].css", - "cssHeadDataCompression": true, - "devtoolFallbackModuleFilenameTemplate": undefined, - "devtoolModuleFilenameTemplate": undefined, - "devtoolNamespace": "@rspack/test-tools", - "enabledChunkLoadingTypes": Array [ - "jsonp", - "import-scripts", + output: Object { + assetModuleFilename: [hash][ext][query], + asyncChunks: true, + charset: true, + chunkFilename: [name].js, + chunkFormat: array-push, + chunkLoadTimeout: 120000, + chunkLoading: jsonp, + chunkLoadingGlobal: webpackChunk_rspack_test_tools, + clean: false, + crossOriginLoading: false, + cssChunkFilename: [name].css, + cssFilename: [name].css, + cssHeadDataCompression: true, + devtoolFallbackModuleFilenameTemplate: undefined, + devtoolModuleFilenameTemplate: undefined, + devtoolNamespace: @rspack/test-tools, + enabledChunkLoadingTypes: Array [ + jsonp, + import-scripts, ], - "enabledLibraryTypes": Array [], - "enabledWasmLoadingTypes": Array [ - "fetch", + enabledLibraryTypes: Array [], + enabledWasmLoadingTypes: Array [ + fetch, ], - "environment": Object { - "arrowFunction": true, - "asyncFunction": true, - "bigIntLiteral": true, - "const": true, - "destructuring": true, - "document": true, - "dynamicImport": undefined, - "dynamicImportInWorker": undefined, - "forOf": true, - "globalThis": undefined, - "module": undefined, - "nodePrefixForCoreModules": true, - "optionalChaining": true, - "templateLiteral": true, + environment: Object { + arrowFunction: true, + asyncFunction: true, + bigIntLiteral: true, + const: true, + destructuring: true, + document: true, + dynamicImport: undefined, + dynamicImportInWorker: undefined, + forOf: true, + globalThis: undefined, + module: undefined, + nodePrefixForCoreModules: true, + optionalChaining: true, + templateLiteral: true, }, - "filename": "[name].js", - "globalObject": "self", - "hashDigest": "hex", - "hashDigestLength": 20, - "hashFunction": "md4", - "hashSalt": undefined, - "hotUpdateChunkFilename": "[id].[fullhash].hot-update.js", - "hotUpdateGlobal": "webpackHotUpdate_rspack_test_tools", - "hotUpdateMainFilename": "[runtime].[fullhash].hot-update.json", - "iife": true, - "importFunctionName": "import", - "importMetaName": "import.meta", - "library": undefined, - "module": false, - "path": "/dist", - "pathinfo": false, - "publicPath": "auto", - "scriptType": false, - "sourceMapFilename": "[file].map[query]", - "strictModuleErrorHandling": false, - "trustedTypes": undefined, - "uniqueName": "@rspack/test-tools", - "wasmLoading": "fetch", - "webassemblyModuleFilename": "[hash].module.wasm", - "workerChunkLoading": "import-scripts", - "workerPublicPath": "", - "workerWasmLoading": "fetch", + filename: [name].js, + globalObject: self, + hashDigest: hex, + hashDigestLength: 20, + hashFunction: md4, + hashSalt: undefined, + hotUpdateChunkFilename: [id].[fullhash].hot-update.js, + hotUpdateGlobal: webpackHotUpdate_rspack_test_tools, + hotUpdateMainFilename: [runtime].[fullhash].hot-update.json, + iife: true, + importFunctionName: import, + importMetaName: import.meta, + library: undefined, + module: false, + path: /dist, + pathinfo: false, + publicPath: auto, + scriptType: false, + sourceMapFilename: [file].map[query], + strictModuleErrorHandling: false, + trustedTypes: undefined, + uniqueName: @rspack/test-tools, + wasmLoading: fetch, + webassemblyModuleFilename: [hash].module.wasm, + workerChunkLoading: import-scripts, + workerPublicPath: , + workerWasmLoading: fetch, }, - "performance": false, - "plugins": Array [], - "profile": false, - "resolve": Object { - "aliasFields": Array [], - "byDependency": Object { - "commonjs": Object { - "aliasFields": Array [ - "browser", + performance: false, + plugins: Array [], + profile: false, + resolve: Object { + aliasFields: Array [], + byDependency: Object { + commonjs: Object { + aliasFields: Array [ + browser, ], - "conditionNames": Array [ - "require", - "module", - "...", + conditionNames: Array [ + require, + module, + ..., ], - "extensions": Array [ - ".js", - ".json", - ".wasm", + extensions: Array [ + .js, + .json, + .wasm, ], - "mainFields": Array [ - "browser", - "module", - "...", + mainFields: Array [ + browser, + module, + ..., ], }, - "esm": Object { - "aliasFields": Array [ - "browser", + esm: Object { + aliasFields: Array [ + browser, ], - "conditionNames": Array [ - "import", - "module", - "...", + conditionNames: Array [ + import, + module, + ..., ], - "extensions": Array [ - ".js", - ".json", - ".wasm", + extensions: Array [ + .js, + .json, + .wasm, ], - "mainFields": Array [ - "browser", - "module", - "...", + mainFields: Array [ + browser, + module, + ..., ], }, - "unknown": Object { - "aliasFields": Array [ - "browser", + unknown: Object { + aliasFields: Array [ + browser, ], - "conditionNames": Array [ - "require", - "module", - "...", + conditionNames: Array [ + require, + module, + ..., ], - "extensions": Array [ - ".js", - ".json", - ".wasm", + extensions: Array [ + .js, + .json, + .wasm, ], - "mainFields": Array [ - "browser", - "module", - "...", + mainFields: Array [ + browser, + module, + ..., ], }, - "url": Object { - "preferRelative": true, + url: Object { + preferRelative: true, }, - "wasm": Object { - "aliasFields": Array [ - "browser", + wasm: Object { + aliasFields: Array [ + browser, ], - "conditionNames": Array [ - "import", - "module", - "...", + conditionNames: Array [ + import, + module, + ..., ], - "extensions": Array [ - ".js", - ".json", - ".wasm", + extensions: Array [ + .js, + .json, + .wasm, ], - "mainFields": Array [ - "browser", - "module", - "...", + mainFields: Array [ + browser, + module, + ..., ], }, - "worker": Object { - "aliasFields": Array [ - "browser", + worker: Object { + aliasFields: Array [ + browser, ], - "conditionNames": Array [ - "import", - "module", - "...", + conditionNames: Array [ + import, + module, + ..., ], - "extensions": Array [ - ".js", - ".json", - ".wasm", + extensions: Array [ + .js, + .json, + .wasm, ], - "mainFields": Array [ - "browser", - "module", - "...", + mainFields: Array [ + browser, + module, + ..., ], - "preferRelative": true, + preferRelative: true, }, }, - "conditionNames": Array [ - "webpack", - "production", - "browser", + conditionNames: Array [ + webpack, + production, + browser, ], - "exportsFields": Array [ - "exports", + exportsFields: Array [ + exports, ], - "extensions": Array [], - "importsFields": Array [ - "imports", + extensions: Array [], + importsFields: Array [ + imports, ], - "mainFields": Array [ - "main", + mainFields: Array [ + main, ], - "mainFiles": Array [ - "index", + mainFiles: Array [ + index, ], - "modules": Array [ - "node_modules", + modules: Array [ + node_modules, ], - "roots": Array [ - "", + roots: Array [ + , ], }, - "resolveLoader": Object { - "conditionNames": Array [ - "loader", - "require", - "node", + resolveLoader: Object { + conditionNames: Array [ + loader, + require, + node, ], - "exportsFields": Array [ - "exports", + exportsFields: Array [ + exports, ], - "extensions": Array [ - ".js", + extensions: Array [ + .js, ], - "mainFields": Array [ - "loader", - "main", + mainFields: Array [ + loader, + main, ], - "mainFiles": Array [ - "index", + mainFiles: Array [ + index, ], }, - "snapshot": Object {}, - "stats": Object {}, - "target": "web", - "watch": false, - "watchOptions": Object {}, + snapshot: Object {}, + stats: Object {}, + target: web, + watch: false, + watchOptions: Object {}, } `; diff --git a/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap index 515529bde9b..1fefc46e8f9 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap @@ -2,1509 +2,1509 @@ exports[`statsAPI statsAPI/basic should have stats 1`] = ` Object { - "assets": Array [ + assets: Array [ Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "auxiliaryChunks": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [ - "main", - ], - "chunks": Array [ - "909", - ], - "emitted": true, - "filteredRelated": 0, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [], - "isOverSizeLimit": false, - "javascriptModule": false, - "minimized": true, - "related": Object {}, + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + auxiliaryChunks: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [ + main, + ], + chunks: Array [ + 909, + ], + emitted: true, + filteredRelated: 0, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [], + isOverSizeLimit: false, + javascriptModule: false, + minimized: true, + related: Object {}, }, - "isOverSizeLimit": false, - "name": "main.js", - "related": Array [], - "size": 207, - "type": "asset", + isOverSizeLimit: false, + name: main.js, + related: Array [], + size: 207, + type: asset, }, ], - "assetsByChunkName": Object { - "main": Array [ - "main.js", + assetsByChunkName: Object { + main: Array [ + main.js, ], }, - "children": Array [], - "chunks": Array [ + children: Array [], + chunks: Array [ Object { - "auxiliaryFiles": Array [], - "children": Array [], - "childrenByOrder": Object {}, - "entry": true, - "files": Array [ - "main.js", - ], - "filteredModules": undefined, - "hash": "ef6849a04b135f983911", - "id": "909", - "idHints": Array [], - "initial": true, - "modules": Array [ + auxiliaryFiles: Array [], + children: Array [], + childrenByOrder: Object {}, + entry: true, + files: Array [ + main.js, + ], + filteredModules: undefined, + hash: ef6849a04b135f983911, + id: 909, + idHints: Array [], + initial: true, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": false, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "585", - "identifier": "/tests/fixtures/a.js", - "index": 0, - "index2": 0, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/a.js", - "nameForCondition": "/tests/fixtures/a.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/a.js:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", + codeGenerated: true, + dependent: false, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 585, + identifier: /tests/fixtures/a.js, + index: 0, + index2: 0, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/a.js, + nameForCondition: /tests/fixtures/a.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/a.js, + ModuleConcatenation bailout: Module is not an ECMAScript module, ], - "optional": false, - "orphan": false, - "postOrderIndex": 0, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [ + optional: false, + orphan: false, + postOrderIndex: 0, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "entry", - "userRequest": "./fixtures/a", + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/a, }, Object { - "moduleId": "585", - "moduleIdentifier": "/tests/fixtures/a.js", - "moduleName": "./fixtures/a.js", - "resolvedModule": "./fixtures/a.js", - "resolvedModuleId": "585", - "resolvedModuleIdentifier": "/tests/fixtures/a.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 585, + moduleIdentifier: /tests/fixtures/a.js, + moduleName: ./fixtures/a.js, + resolvedModule: ./fixtures/a.js, + resolvedModuleId: 585, + resolvedModuleIdentifier: /tests/fixtures/a.js, + type: cjs self exports reference, + userRequest: self, }, ], - "size": 55, - "sizes": Object { - "javascript": 55, + size: 55, + sizes: Object { + javascript: 55, }, - "source": "module.exports = function a() { - return \\"This is a\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function a() { + return "This is a"; +};, + type: module, + usedExports: null, + warnings: 0, }, ], - "names": Array [ - "main", + names: Array [ + main, ], - "origins": Array [ + origins: Array [ Object { - "loc": "main", - "module": "", - "moduleId": undefined, - "moduleIdentifier": "", - "moduleName": "", - "request": "./fixtures/a", + loc: main, + module: , + moduleId: undefined, + moduleIdentifier: , + moduleName: , + request: ./fixtures/a, }, ], - "parents": Array [], - "reason": undefined, - "rendered": true, - "runtime": Array [ - "main", + parents: Array [], + reason: undefined, + rendered: true, + runtime: Array [ + main, ], - "siblings": Array [], - "size": 55, - "sizes": Object { - "javascript": 55, + siblings: Array [], + size: 55, + sizes: Object { + javascript: 55, }, - "type": "chunk", + type: chunk, }, ], - "entrypoints": Object { - "main": Object { - "assets": Array [ + entrypoints: Object { + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 207, + name: main.js, + size: 207, }, ], - "assetsSize": 207, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "909", - ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + assetsSize: 207, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 909, + ], + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, }, - "env": undefined, - "errors": Array [], - "errorsCount": 0, - "filteredAssets": undefined, - "filteredModules": undefined, - "hash": "d27b1f8bbdf2e13f1b91", - "modules": Array [ + env: undefined, + errors: Array [], + errorsCount: 0, + filteredAssets: undefined, + filteredModules: undefined, + hash: d27b1f8bbdf2e13f1b91, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": undefined, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "585", - "identifier": "/tests/fixtures/a.js", - "index": 0, - "index2": 0, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/a.js", - "nameForCondition": "/tests/fixtures/a.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/a.js:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", - ], - "optional": false, - "orphan": false, - "postOrderIndex": 0, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: undefined, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 585, + identifier: /tests/fixtures/a.js, + index: 0, + index2: 0, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/a.js, + nameForCondition: /tests/fixtures/a.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/a.js, + ModuleConcatenation bailout: Module is not an ECMAScript module, + ], + optional: false, + orphan: false, + postOrderIndex: 0, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "entry", - "userRequest": "./fixtures/a", + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/a, }, Object { - "moduleId": "585", - "moduleIdentifier": "/tests/fixtures/a.js", - "moduleName": "./fixtures/a.js", - "resolvedModule": "./fixtures/a.js", - "resolvedModuleId": "585", - "resolvedModuleIdentifier": "/tests/fixtures/a.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 585, + moduleIdentifier: /tests/fixtures/a.js, + moduleName: ./fixtures/a.js, + resolvedModule: ./fixtures/a.js, + resolvedModuleId: 585, + resolvedModuleIdentifier: /tests/fixtures/a.js, + type: cjs self exports reference, + userRequest: self, }, ], - "size": 55, - "sizes": Object { - "javascript": 55, + size: 55, + sizes: Object { + javascript: 55, }, - "source": "module.exports = function a() { - return \\"This is a\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function a() { + return "This is a"; +};, + type: module, + usedExports: null, + warnings: 0, }, ], - "namedChunkGroups": Object { - "main": Object { - "assets": Array [ + namedChunkGroups: Object { + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 207, + name: main.js, + size: 207, }, ], - "assetsSize": 207, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "909", - ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + assetsSize: 207, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 909, + ], + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, }, - "outputPath": "/dist", - "publicPath": "auto", - "warnings": Array [], - "warningsCount": 0, + outputPath: /dist, + publicPath: auto, + warnings: Array [], + warningsCount: 0, } `; exports[`statsAPI statsAPI/exports should have usedExports and providedExports stats 1`] = ` Object { - "assets": Array [ + assets: Array [ Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "auxiliaryChunks": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [ - "main", - ], - "chunks": Array [ - "909", - ], - "emitted": true, - "filteredRelated": 0, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [], - "isOverSizeLimit": false, - "javascriptModule": false, - "minimized": true, - "related": Object {}, + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + auxiliaryChunks: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [ + main, + ], + chunks: Array [ + 909, + ], + emitted: true, + filteredRelated: 0, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [], + isOverSizeLimit: false, + javascriptModule: false, + minimized: true, + related: Object {}, }, - "isOverSizeLimit": false, - "name": "main.js", - "related": Array [], - "size": 441, - "type": "asset", + isOverSizeLimit: false, + name: main.js, + related: Array [], + size: 441, + type: asset, }, ], - "assetsByChunkName": Object { - "main": Array [ - "main.js", + assetsByChunkName: Object { + main: Array [ + main.js, ], }, - "children": Array [], - "chunks": Array [ + children: Array [], + chunks: Array [ Object { - "auxiliaryFiles": Array [], - "children": Array [], - "childrenByOrder": Object {}, - "entry": true, - "files": Array [ - "main.js", - ], - "filteredModules": undefined, - "hash": "9b2b751ee9c70405e371", - "id": "909", - "idHints": Array [], - "initial": true, - "modules": Array [ + auxiliaryFiles: Array [], + children: Array [], + childrenByOrder: Object {}, + entry: true, + files: Array [ + main.js, + ], + filteredModules: undefined, + hash: 9b2b751ee9c70405e371, + id: 909, + idHints: Array [], + initial: true, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: false, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": false, - "depth": 0, - "errors": 0, - "failed": false, - "filteredModules": undefined, - "filteredReasons": undefined, - "id": "533", - "identifier": "/tests/fixtures/esm/abc.js|0e47874493fdefd960142324ecb88ecc", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/esm", - "modules": Array [ + codeGenerated: true, + dependent: false, + depth: 0, + errors: 0, + failed: false, + filteredModules: undefined, + filteredReasons: undefined, + id: 533, + identifier: /tests/fixtures/esm/abc.js|0e47874493fdefd960142324ecb88ecc, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/esm, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": true, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/abc.js", - "nameForCondition": "/tests/fixtures/esm/abc.js", - "optimizationBailout": Array [ - "ModuleConcatenation bailout: Module is an entry point", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: true, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/abc.js, + nameForCondition: /tests/fixtures/esm/abc.js, + optimizationBailout: Array [ + ModuleConcatenation bailout: Module is an entry point, ], - "optional": false, - "orphan": true, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [], - "size": 80, - "sizes": Object { - "javascript": 80, + optional: false, + orphan: true, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [], + size: 80, + sizes: Object { + javascript: 80, }, - "type": "module", - "usedExports": Array [], - "warnings": 0, + type: module, + usedExports: Array [], + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": true, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/a.js", - "index": 1, - "index2": 0, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: true, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/a.js, + index: 1, + index2: 0, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/a.js", - "nameForCondition": "/tests/fixtures/esm/a.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 0, - "preOrderIndex": 1, - "providedExports": Array [ - "a", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/a.js, + nameForCondition: /tests/fixtures/esm/a.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 0, + preOrderIndex: 1, + providedExports: Array [ + a, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./a, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./a, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": Array [ - "a", + type: module, + usedExports: Array [ + a, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": true, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/b.js", - "index": 2, - "index2": 1, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: true, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/b.js, + index: 2, + index2: 1, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/b.js", - "nameForCondition": "/tests/fixtures/esm/b.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 1, - "preOrderIndex": 2, - "providedExports": Array [ - "b", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/b.js, + nameForCondition: /tests/fixtures/esm/b.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 1, + preOrderIndex: 2, + providedExports: Array [ + b, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./b, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./b, }, ], - "size": 38, - "sizes": Object { - "javascript": 38, + size: 38, + sizes: Object { + javascript: 38, }, - "type": "module", - "usedExports": Array [ - "default", + type: module, + usedExports: Array [ + default, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": true, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/c.js", - "index": 3, - "index2": 2, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: true, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/c.js, + index: 3, + index2: 2, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/c.js", - "nameForCondition": "/tests/fixtures/esm/c.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 2, - "preOrderIndex": 3, - "providedExports": Array [ - "c", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/c.js, + nameForCondition: /tests/fixtures/esm/c.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 2, + preOrderIndex: 3, + providedExports: Array [ + c, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./c, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./c, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": true, - "warnings": 0, + type: module, + usedExports: true, + warnings: 0, }, ], - "name": "./fixtures/esm/abc.js + 3 modules", - "nameForCondition": "/tests/fixtures/esm/abc.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": false, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [ + name: ./fixtures/esm/abc.js + 3 modules, + nameForCondition: /tests/fixtures/esm/abc.js, + optimizationBailout: Array [], + optional: false, + orphan: false, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "entry", - "userRequest": "./fixtures/esm/abc", + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/esm/abc, }, ], - "size": 192, - "sizes": Object { - "javascript": 192, + size: 192, + sizes: Object { + javascript: 192, }, - "type": "module", - "usedExports": Array [], - "warnings": 0, + type: module, + usedExports: Array [], + warnings: 0, }, ], - "names": Array [ - "main", + names: Array [ + main, ], - "origins": Array [ + origins: Array [ Object { - "loc": "main", - "module": "", - "moduleId": undefined, - "moduleIdentifier": "", - "moduleName": "", - "request": "./fixtures/esm/abc", + loc: main, + module: , + moduleId: undefined, + moduleIdentifier: , + moduleName: , + request: ./fixtures/esm/abc, }, ], - "parents": Array [], - "reason": undefined, - "rendered": true, - "runtime": Array [ - "main", - ], - "siblings": Array [], - "size": 192, - "sizes": Object { - "javascript": 192, - "runtime": 677, + parents: Array [], + reason: undefined, + rendered: true, + runtime: Array [ + main, + ], + siblings: Array [], + size: 192, + sizes: Object { + javascript: 192, + runtime: 677, }, - "type": "chunk", + type: chunk, }, ], - "entrypoints": Object { - "main": Object { - "assets": Array [ + entrypoints: Object { + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 441, + name: main.js, + size: 441, }, ], - "assetsSize": 441, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "909", - ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + assetsSize: 441, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 909, + ], + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, }, - "errors": Array [], - "errorsCount": 0, - "filteredAssets": undefined, - "filteredModules": undefined, - "hash": "345f9530d25377198050", - "modules": Array [ + errors: Array [], + errorsCount: 0, + filteredAssets: undefined, + filteredModules: undefined, + hash: 345f9530d25377198050, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/abc.js", - "nameForCondition": "/tests/fixtures/esm/abc.js", - "optimizationBailout": Array [ - "ModuleConcatenation bailout: Module is an entry point", - ], - "optional": false, - "orphan": true, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [], - "size": 80, - "sizes": Object { - "javascript": 80, + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/abc.js, + nameForCondition: /tests/fixtures/esm/abc.js, + optimizationBailout: Array [ + ModuleConcatenation bailout: Module is an entry point, + ], + optional: false, + orphan: true, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [], + size: 80, + sizes: Object { + javascript: 80, }, - "type": "module", - "usedExports": Array [], - "warnings": 0, + type: module, + usedExports: Array [], + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": undefined, - "depth": 0, - "errors": 0, - "failed": false, - "filteredModules": undefined, - "filteredReasons": undefined, - "id": "533", - "identifier": "/tests/fixtures/esm/abc.js|0e47874493fdefd960142324ecb88ecc", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/esm", - "modules": Array [ + assets: Array [], + buildTimeExecuted: false, + built: false, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: undefined, + depth: 0, + errors: 0, + failed: false, + filteredModules: undefined, + filteredReasons: undefined, + id: 533, + identifier: /tests/fixtures/esm/abc.js|0e47874493fdefd960142324ecb88ecc, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/esm, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/abc.js", - "nameForCondition": "/tests/fixtures/esm/abc.js", - "optimizationBailout": Array [ - "ModuleConcatenation bailout: Module is an entry point", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/abc.js, + nameForCondition: /tests/fixtures/esm/abc.js, + optimizationBailout: Array [ + ModuleConcatenation bailout: Module is an entry point, ], - "optional": false, - "orphan": true, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [], - "size": 80, - "sizes": Object { - "javascript": 80, + optional: false, + orphan: true, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [], + size: 80, + sizes: Object { + javascript: 80, }, - "type": "module", - "usedExports": Array [], - "warnings": 0, + type: module, + usedExports: Array [], + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/a.js", - "index": 1, - "index2": 0, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/a.js, + index: 1, + index2: 0, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/a.js", - "nameForCondition": "/tests/fixtures/esm/a.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 0, - "preOrderIndex": 1, - "providedExports": Array [ - "a", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/a.js, + nameForCondition: /tests/fixtures/esm/a.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 0, + preOrderIndex: 1, + providedExports: Array [ + a, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./a, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./a, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": Array [ - "a", + type: module, + usedExports: Array [ + a, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/b.js", - "index": 2, - "index2": 1, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/b.js, + index: 2, + index2: 1, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/b.js", - "nameForCondition": "/tests/fixtures/esm/b.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 1, - "preOrderIndex": 2, - "providedExports": Array [ - "b", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/b.js, + nameForCondition: /tests/fixtures/esm/b.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 1, + preOrderIndex: 2, + providedExports: Array [ + b, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./b, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./b, }, ], - "size": 38, - "sizes": Object { - "javascript": 38, + size: 38, + sizes: Object { + javascript: 38, }, - "type": "module", - "usedExports": Array [ - "default", + type: module, + usedExports: Array [ + default, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/c.js", - "index": 3, - "index2": 2, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/c.js, + index: 3, + index2: 2, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/c.js", - "nameForCondition": "/tests/fixtures/esm/c.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 2, - "preOrderIndex": 3, - "providedExports": Array [ - "c", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/c.js, + nameForCondition: /tests/fixtures/esm/c.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 2, + preOrderIndex: 3, + providedExports: Array [ + c, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./c, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./c, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": true, - "warnings": 0, + type: module, + usedExports: true, + warnings: 0, }, ], - "name": "./fixtures/esm/abc.js + 3 modules", - "nameForCondition": "/tests/fixtures/esm/abc.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": false, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [ + name: ./fixtures/esm/abc.js + 3 modules, + nameForCondition: /tests/fixtures/esm/abc.js, + optimizationBailout: Array [], + optional: false, + orphan: false, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "entry", - "userRequest": "./fixtures/esm/abc", + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/esm/abc, }, ], - "size": 192, - "sizes": Object { - "javascript": 192, + size: 192, + sizes: Object { + javascript: 192, }, - "type": "module", - "usedExports": Array [], - "warnings": 0, + type: module, + usedExports: Array [], + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/a.js", - "index": 1, - "index2": 0, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/a.js, + index: 1, + index2: 0, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/a.js", - "nameForCondition": "/tests/fixtures/esm/a.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 0, - "preOrderIndex": 1, - "providedExports": Array [ - "a", - "default", - ], - "reasons": Array [ + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/a.js, + nameForCondition: /tests/fixtures/esm/a.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 0, + preOrderIndex: 1, + providedExports: Array [ + a, + default, + ], + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./a, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./a, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": Array [ - "a", + type: module, + usedExports: Array [ + a, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/b.js", - "index": 2, - "index2": 1, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/b.js, + index: 2, + index2: 1, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/b.js", - "nameForCondition": "/tests/fixtures/esm/b.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 1, - "preOrderIndex": 2, - "providedExports": Array [ - "b", - "default", - ], - "reasons": Array [ + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/b.js, + nameForCondition: /tests/fixtures/esm/b.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 1, + preOrderIndex: 2, + providedExports: Array [ + b, + default, + ], + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./b, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./b, }, ], - "size": 38, - "sizes": Object { - "javascript": 38, + size: 38, + sizes: Object { + javascript: 38, }, - "type": "module", - "usedExports": Array [ - "default", + type: module, + usedExports: Array [ + default, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/c.js", - "index": 3, - "index2": 2, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/c.js, + index: 3, + index2: 2, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/c.js", - "nameForCondition": "/tests/fixtures/esm/c.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 2, - "preOrderIndex": 3, - "providedExports": Array [ - "c", - "default", - ], - "reasons": Array [ + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/c.js, + nameForCondition: /tests/fixtures/esm/c.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 2, + preOrderIndex: 3, + providedExports: Array [ + c, + default, + ], + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./c, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./c, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": true, - "warnings": 0, + type: module, + usedExports: true, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": false, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/define_property_getters", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/define_property_getters", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": false, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 290, - "sizes": Object { - "runtime": 290, + assets: Array [], + buildTimeExecuted: false, + built: false, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: false, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/define_property_getters, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/define_property_getters, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: false, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 290, + sizes: Object { + runtime: 290, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": false, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/has_own_property", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/has_own_property", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": false, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 107, - "sizes": Object { - "runtime": 107, + assets: Array [], + buildTimeExecuted: false, + built: false, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: false, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/has_own_property, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/has_own_property, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: false, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 107, + sizes: Object { + runtime: 107, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": false, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/make_namespace_object", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/make_namespace_object", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": false, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 280, - "sizes": Object { - "runtime": 280, + assets: Array [], + buildTimeExecuted: false, + built: false, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: false, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/make_namespace_object, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/make_namespace_object, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: false, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 280, + sizes: Object { + runtime: 280, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, ], - "namedChunkGroups": Object { - "main": Object { - "assets": Array [ + namedChunkGroups: Object { + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 441, + name: main.js, + size: 441, }, ], - "assetsSize": 441, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "909", - ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + assetsSize: 441, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 909, + ], + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, }, - "outputPath": "/dist", - "publicPath": "auto", - "warnings": Array [], - "warningsCount": 0, + outputPath: /dist, + publicPath: auto, + warnings: Array [], + warningsCount: 0, } `; exports[`statsAPI statsAPI/ids should have ids when ids is true 1`] = ` Object { - "assets": Array [ + assets: Array [ Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "auxiliaryChunks": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [ - "main", - ], - "chunks": Array [ - "909", - ], - "emitted": true, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [], - "isOverSizeLimit": false, - "javascriptModule": false, - "minimized": true, - "related": Object {}, + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + auxiliaryChunks: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [ + main, + ], + chunks: Array [ + 909, + ], + emitted: true, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [], + isOverSizeLimit: false, + javascriptModule: false, + minimized: true, + related: Object {}, }, - "name": "main.js", - "size": 207, - "type": "asset", + name: main.js, + size: 207, + type: asset, }, ], - "assetsByChunkName": Object { - "main": Array [ - "main.js", + assetsByChunkName: Object { + main: Array [ + main.js, ], }, - "chunks": Array [ + chunks: Array [ Object { - "auxiliaryFiles": Array [], - "childrenByOrder": Object {}, - "entry": true, - "files": Array [ - "main.js", - ], - "hash": "ef6849a04b135f983911", - "id": "909", - "idHints": Array [], - "initial": true, - "names": Array [ - "main", - ], - "reason": undefined, - "rendered": true, - "runtime": Array [ - "main", - ], - "size": 55, - "sizes": Object { - "javascript": 55, + auxiliaryFiles: Array [], + childrenByOrder: Object {}, + entry: true, + files: Array [ + main.js, + ], + hash: ef6849a04b135f983911, + id: 909, + idHints: Array [], + initial: true, + names: Array [ + main, + ], + reason: undefined, + rendered: true, + runtime: Array [ + main, + ], + size: 55, + sizes: Object { + javascript: 55, }, - "type": "chunk", + type: chunk, }, ], - "filteredAssets": undefined, - "filteredModules": undefined, - "modules": Array [ + filteredAssets: undefined, + filteredModules: undefined, + modules: Array [ Object { - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": undefined, - "errors": 0, - "failed": false, - "id": "585", - "identifier": "/tests/fixtures/a.js", - "index": 0, - "index2": 0, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/a.js", - "nameForCondition": "/tests/fixtures/a.js", - "optional": false, - "orphan": false, - "postOrderIndex": 0, - "preOrderIndex": 0, - "size": 55, - "sizes": Object { - "javascript": 55, + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: undefined, + errors: 0, + failed: false, + id: 585, + identifier: /tests/fixtures/a.js, + index: 0, + index2: 0, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/a.js, + nameForCondition: /tests/fixtures/a.js, + optional: false, + orphan: false, + postOrderIndex: 0, + preOrderIndex: 0, + size: 55, + sizes: Object { + javascript: 55, }, - "type": "module", - "warnings": 0, + type: module, + warnings: 0, }, ], } @@ -1512,142 +1512,142 @@ Object { exports[`statsAPI statsAPI/layer should have module layer 1`] = ` Object { - "filteredModules": undefined, - "modules": Array [ + filteredModules: undefined, + modules: Array [ Object { - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "codeGenerated": true, - "dependent": undefined, - "errors": 0, - "failed": false, - "identifier": "javascript/auto|/tests/fixtures/abc.js|test", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": "test", - "moduleType": "javascript/auto", - "name": "./fixtures/abc.js", - "nameForCondition": "/tests/fixtures/abc.js", - "optional": false, - "orphan": false, - "postOrderIndex": 3, - "preOrderIndex": 0, - "size": 83, - "sizes": Object { - "javascript": 83, + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + codeGenerated: true, + dependent: undefined, + errors: 0, + failed: false, + identifier: javascript/auto|/tests/fixtures/abc.js|test, + index: 0, + index2: 3, + issuer: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: test, + moduleType: javascript/auto, + name: ./fixtures/abc.js, + nameForCondition: /tests/fixtures/abc.js, + optional: false, + orphan: false, + postOrderIndex: 3, + preOrderIndex: 0, + size: 83, + sizes: Object { + javascript: 83, }, - "type": "module", - "warnings": 0, + type: module, + warnings: 0, }, Object { - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "codeGenerated": true, - "dependent": undefined, - "errors": 0, - "failed": false, - "identifier": "javascript/auto|/tests/fixtures/a.js|test", - "index": 1, - "index2": 0, - "issuer": "javascript/auto|/tests/fixtures/abc.js|test", - "issuerName": "./fixtures/abc.js", - "issuerPath": Array [ + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + codeGenerated: true, + dependent: undefined, + errors: 0, + failed: false, + identifier: javascript/auto|/tests/fixtures/a.js|test, + index: 1, + index2: 0, + issuer: javascript/auto|/tests/fixtures/abc.js|test, + issuerName: ./fixtures/abc.js, + issuerPath: Array [ Object { - "identifier": "javascript/auto|/tests/fixtures/abc.js|test", - "name": "./fixtures/abc.js", + identifier: javascript/auto|/tests/fixtures/abc.js|test, + name: ./fixtures/abc.js, }, ], - "layer": "test", - "moduleType": "javascript/auto", - "name": "./fixtures/a.js", - "nameForCondition": "/tests/fixtures/a.js", - "optional": false, - "orphan": false, - "postOrderIndex": 0, - "preOrderIndex": 1, - "size": 55, - "sizes": Object { - "javascript": 55, + layer: test, + moduleType: javascript/auto, + name: ./fixtures/a.js, + nameForCondition: /tests/fixtures/a.js, + optional: false, + orphan: false, + postOrderIndex: 0, + preOrderIndex: 1, + size: 55, + sizes: Object { + javascript: 55, }, - "type": "module", - "warnings": 0, + type: module, + warnings: 0, }, Object { - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "codeGenerated": true, - "dependent": undefined, - "errors": 0, - "failed": false, - "identifier": "javascript/auto|/tests/fixtures/b.js|test", - "index": 2, - "index2": 1, - "issuer": "javascript/auto|/tests/fixtures/abc.js|test", - "issuerName": "./fixtures/abc.js", - "issuerPath": Array [ + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + codeGenerated: true, + dependent: undefined, + errors: 0, + failed: false, + identifier: javascript/auto|/tests/fixtures/b.js|test, + index: 2, + index2: 1, + issuer: javascript/auto|/tests/fixtures/abc.js|test, + issuerName: ./fixtures/abc.js, + issuerPath: Array [ Object { - "identifier": "javascript/auto|/tests/fixtures/abc.js|test", - "name": "./fixtures/abc.js", + identifier: javascript/auto|/tests/fixtures/abc.js|test, + name: ./fixtures/abc.js, }, ], - "layer": "test", - "moduleType": "javascript/auto", - "name": "./fixtures/b.js", - "nameForCondition": "/tests/fixtures/b.js", - "optional": false, - "orphan": false, - "postOrderIndex": 1, - "preOrderIndex": 2, - "size": 94, - "sizes": Object { - "javascript": 94, + layer: test, + moduleType: javascript/auto, + name: ./fixtures/b.js, + nameForCondition: /tests/fixtures/b.js, + optional: false, + orphan: false, + postOrderIndex: 1, + preOrderIndex: 2, + size: 94, + sizes: Object { + javascript: 94, }, - "type": "module", - "warnings": 0, + type: module, + warnings: 0, }, Object { - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "codeGenerated": true, - "dependent": undefined, - "errors": 0, - "failed": false, - "identifier": "javascript/auto|/tests/fixtures/c.js|test", - "index": 3, - "index2": 2, - "issuer": "javascript/auto|/tests/fixtures/abc.js|test", - "issuerName": "./fixtures/abc.js", - "issuerPath": Array [ + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + codeGenerated: true, + dependent: undefined, + errors: 0, + failed: false, + identifier: javascript/auto|/tests/fixtures/c.js|test, + index: 3, + index2: 2, + issuer: javascript/auto|/tests/fixtures/abc.js|test, + issuerName: ./fixtures/abc.js, + issuerPath: Array [ Object { - "identifier": "javascript/auto|/tests/fixtures/abc.js|test", - "name": "./fixtures/abc.js", + identifier: javascript/auto|/tests/fixtures/abc.js|test, + name: ./fixtures/abc.js, }, ], - "layer": "test", - "moduleType": "javascript/auto", - "name": "./fixtures/c.js", - "nameForCondition": "/tests/fixtures/c.js", - "optional": false, - "orphan": false, - "postOrderIndex": 2, - "preOrderIndex": 3, - "size": 72, - "sizes": Object { - "javascript": 72, + layer: test, + moduleType: javascript/auto, + name: ./fixtures/c.js, + nameForCondition: /tests/fixtures/c.js, + optional: false, + orphan: false, + postOrderIndex: 2, + preOrderIndex: 3, + size: 72, + sizes: Object { + javascript: 72, }, - "type": "module", - "warnings": 0, + type: module, + warnings: 0, }, ], } @@ -1655,719 +1655,717 @@ Object { exports[`statsAPI statsAPI/with-query should output stats with query 1`] = ` Object { - "assets": Array [ + assets: Array [ Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "auxiliaryChunks": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [ - "main", - ], - "chunks": Array [ - "909", - ], - "emitted": true, - "filteredRelated": 0, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [], - "isOverSizeLimit": false, - "javascriptModule": false, - "minimized": true, - "related": Object {}, + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + auxiliaryChunks: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [ + main, + ], + chunks: Array [ + 909, + ], + emitted: true, + filteredRelated: 0, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [], + isOverSizeLimit: false, + javascriptModule: false, + minimized: true, + related: Object {}, }, - "isOverSizeLimit": false, - "name": "main.js", - "related": Array [], - "size": 346, - "type": "asset", + isOverSizeLimit: false, + name: main.js, + related: Array [], + size: 346, + type: asset, }, ], - "assetsByChunkName": Object { - "main": Array [ - "main.js", + assetsByChunkName: Object { + main: Array [ + main.js, ], }, - "children": Array [], - "chunks": Array [ + children: Array [], + chunks: Array [ Object { - "auxiliaryFiles": Array [], - "children": Array [], - "childrenByOrder": Object {}, - "entry": true, - "files": Array [ - "main.js", - ], - "filteredModules": undefined, - "hash": "770328aa6786a7bd40f1", - "id": "909", - "idHints": Array [], - "initial": true, - "modules": Array [ + auxiliaryFiles: Array [], + children: Array [], + childrenByOrder: Object {}, + entry: true, + files: Array [ + main.js, + ], + filteredModules: undefined, + hash: 770328aa6786a7bd40f1, + id: 909, + idHints: Array [], + initial: true, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": true, - "depth": 2, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "585", - "identifier": "/tests/fixtures/a.js", - "index": 3, - "index2": 1, - "issuer": "/tests/fixtures/c.js?c=3", - "issuerId": "432", - "issuerName": "./fixtures/c.js?c=3", - "issuerPath": Array [ + codeGenerated: true, + dependent: true, + depth: 2, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 585, + identifier: /tests/fixtures/a.js, + index: 3, + index2: 1, + issuer: /tests/fixtures/c.js?c=3, + issuerId: 432, + issuerName: ./fixtures/c.js?c=3, + issuerPath: Array [ Object { - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "name": "./fixtures/abc-query.js", + id: 919, + identifier: /tests/fixtures/abc-query.js, + name: ./fixtures/abc-query.js, }, Object { - "id": "432", - "identifier": "/tests/fixtures/c.js?c=3", - "name": "./fixtures/c.js?c=3", + id: 432, + identifier: /tests/fixtures/c.js?c=3, + name: ./fixtures/c.js?c=3, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/a.js", - "nameForCondition": "/tests/fixtures/a.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/a.js:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/a.js, + nameForCondition: /tests/fixtures/a.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/a.js, + ModuleConcatenation bailout: Module is not an ECMAScript module, ], - "optional": false, - "orphan": false, - "postOrderIndex": 1, - "preOrderIndex": 3, - "providedExports": Array [], - "reasons": Array [ + optional: false, + orphan: false, + postOrderIndex: 1, + preOrderIndex: 3, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": "585", - "moduleIdentifier": "/tests/fixtures/a.js", - "moduleName": "./fixtures/a.js", - "resolvedModule": "./fixtures/a.js", - "resolvedModuleId": "585", - "resolvedModuleIdentifier": "/tests/fixtures/a.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 585, + moduleIdentifier: /tests/fixtures/a.js, + moduleName: ./fixtures/a.js, + resolvedModule: ./fixtures/a.js, + resolvedModuleId: 585, + resolvedModuleIdentifier: /tests/fixtures/a.js, + type: cjs self exports reference, + userRequest: self, }, Object { - "moduleId": "432", - "moduleIdentifier": "/tests/fixtures/c.js?c=3", - "moduleName": "./fixtures/c.js?c=3", - "resolvedModule": "./fixtures/c.js?c=3", - "resolvedModuleId": "432", - "resolvedModuleIdentifier": "/tests/fixtures/c.js?c=3", - "type": "cjs require", - "userRequest": "./a", + moduleId: 432, + moduleIdentifier: /tests/fixtures/c.js?c=3, + moduleName: ./fixtures/c.js?c=3, + resolvedModule: ./fixtures/c.js?c=3, + resolvedModuleId: 432, + resolvedModuleIdentifier: /tests/fixtures/c.js?c=3, + type: cjs require, + userRequest: ./a, }, ], - "size": 55, - "sizes": Object { - "javascript": 55, + size: 55, + sizes: Object { + javascript: 55, }, - "source": "module.exports = function a() { - return \\"This is a\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function a() { + return "This is a"; +};, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": true, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "958", - "identifier": "/tests/fixtures/a.js?a=1", - "index": 1, - "index2": 0, - "issuer": "/tests/fixtures/abc-query.js", - "issuerId": "919", - "issuerName": "./fixtures/abc-query.js", - "issuerPath": Array [ + codeGenerated: true, + dependent: true, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 958, + identifier: /tests/fixtures/a.js?a=1, + index: 1, + index2: 0, + issuer: /tests/fixtures/abc-query.js, + issuerId: 919, + issuerName: ./fixtures/abc-query.js, + issuerPath: Array [ Object { - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "name": "./fixtures/abc-query.js", + id: 919, + identifier: /tests/fixtures/abc-query.js, + name: ./fixtures/abc-query.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/a.js?a=1", - "nameForCondition": "/tests/fixtures/a.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/a.js?a=1:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/a.js?a=1, + nameForCondition: /tests/fixtures/a.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/a.js?a=1, + ModuleConcatenation bailout: Module is not an ECMAScript module, ], - "optional": false, - "orphan": false, - "postOrderIndex": 0, - "preOrderIndex": 1, - "providedExports": Array [], - "reasons": Array [ + optional: false, + orphan: false, + postOrderIndex: 0, + preOrderIndex: 1, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": "958", - "moduleIdentifier": "/tests/fixtures/a.js?a=1", - "moduleName": "./fixtures/a.js?a=1", - "resolvedModule": "./fixtures/a.js?a=1", - "resolvedModuleId": "958", - "resolvedModuleIdentifier": "/tests/fixtures/a.js?a=1", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 958, + moduleIdentifier: /tests/fixtures/a.js?a=1, + moduleName: ./fixtures/a.js?a=1, + resolvedModule: ./fixtures/a.js?a=1, + resolvedModuleId: 958, + resolvedModuleIdentifier: /tests/fixtures/a.js?a=1, + type: cjs self exports reference, + userRequest: self, }, Object { - "moduleId": "919", - "moduleIdentifier": "/tests/fixtures/abc-query.js", - "moduleName": "./fixtures/abc-query.js", - "resolvedModule": "./fixtures/abc-query.js", - "resolvedModuleId": "919", - "resolvedModuleIdentifier": "/tests/fixtures/abc-query.js", - "type": "cjs export require", - "userRequest": "./a?a=1", + moduleId: 919, + moduleIdentifier: /tests/fixtures/abc-query.js, + moduleName: ./fixtures/abc-query.js, + resolvedModule: ./fixtures/abc-query.js, + resolvedModuleId: 919, + resolvedModuleIdentifier: /tests/fixtures/abc-query.js, + type: cjs export require, + userRequest: ./a?a=1, }, ], - "size": 55, - "sizes": Object { - "javascript": 55, + size: 55, + sizes: Object { + javascript: 55, }, - "source": "module.exports = function a() { - return \\"This is a\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function a() { + return "This is a"; +};, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": false, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/abc-query.js", - "nameForCondition": "/tests/fixtures/abc-query.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/abc-query.js:1:0-31", - "ModuleConcatenation bailout: Module is not an ECMAScript module", + codeGenerated: true, + dependent: false, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 919, + identifier: /tests/fixtures/abc-query.js, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/abc-query.js, + nameForCondition: /tests/fixtures/abc-query.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/abc-query.js-31, + ModuleConcatenation bailout: Module is not an ECMAScript module, ], - "optional": false, - "orphan": false, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [ - "a", - "c", + optional: false, + orphan: false, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [ + a, + c, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "entry", - "userRequest": "./fixtures/abc-query", + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/abc-query, }, ], - "size": 99, - "sizes": Object { - "javascript": 99, + size: 99, + sizes: Object { + javascript: 99, }, - "source": "exports.a = require(\\"./a?a=1\\"); -// exports.b = require(\\"./b?b=2\\"); -exports.c = require(\\"./c?c=3\\"); -", - "type": "module", - "usedExports": Array [], - "warnings": 0, + source: exports.a = require("./a?a=1"); +// exports.b = require("./b?b=2"); +exports.c = require("./c?c=3");, + type: module, + usedExports: Array [], + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": true, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "432", - "identifier": "/tests/fixtures/c.js?c=3", - "index": 2, - "index2": 2, - "issuer": "/tests/fixtures/abc-query.js", - "issuerId": "919", - "issuerName": "./fixtures/abc-query.js", - "issuerPath": Array [ + codeGenerated: true, + dependent: true, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 432, + identifier: /tests/fixtures/c.js?c=3, + index: 2, + index2: 2, + issuer: /tests/fixtures/abc-query.js, + issuerId: 919, + issuerName: ./fixtures/abc-query.js, + issuerPath: Array [ Object { - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "name": "./fixtures/abc-query.js", + id: 919, + identifier: /tests/fixtures/abc-query.js, + name: ./fixtures/abc-query.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/c.js?c=3", - "nameForCondition": "/tests/fixtures/c.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/c.js?c=3:1:0-4:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/c.js?c=3, + nameForCondition: /tests/fixtures/c.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/c.js?c=3, + ModuleConcatenation bailout: Module is not an ECMAScript module, ], - "optional": false, - "orphan": false, - "postOrderIndex": 2, - "preOrderIndex": 2, - "providedExports": Array [], - "reasons": Array [ + optional: false, + orphan: false, + postOrderIndex: 2, + preOrderIndex: 2, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": "919", - "moduleIdentifier": "/tests/fixtures/abc-query.js", - "moduleName": "./fixtures/abc-query.js", - "resolvedModule": "./fixtures/abc-query.js", - "resolvedModuleId": "919", - "resolvedModuleIdentifier": "/tests/fixtures/abc-query.js", - "type": "cjs export require", - "userRequest": "./c?c=3", + moduleId: 919, + moduleIdentifier: /tests/fixtures/abc-query.js, + moduleName: ./fixtures/abc-query.js, + resolvedModule: ./fixtures/abc-query.js, + resolvedModuleId: 919, + resolvedModuleIdentifier: /tests/fixtures/abc-query.js, + type: cjs export require, + userRequest: ./c?c=3, }, Object { - "moduleId": "432", - "moduleIdentifier": "/tests/fixtures/c.js?c=3", - "moduleName": "./fixtures/c.js?c=3", - "resolvedModule": "./fixtures/c.js?c=3", - "resolvedModuleId": "432", - "resolvedModuleIdentifier": "/tests/fixtures/c.js?c=3", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 432, + moduleIdentifier: /tests/fixtures/c.js?c=3, + moduleName: ./fixtures/c.js?c=3, + resolvedModule: ./fixtures/c.js?c=3, + resolvedModuleId: 432, + resolvedModuleIdentifier: /tests/fixtures/c.js?c=3, + type: cjs self exports reference, + userRequest: self, }, ], - "size": 72, - "sizes": Object { - "javascript": 72, + size: 72, + sizes: Object { + javascript: 72, }, - "source": "module.exports = function b() { - require(\\"./a\\"); - return \\"This is c\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function b() { + require("./a"); + return "This is c"; +};, + type: module, + usedExports: null, + warnings: 0, }, ], - "names": Array [ - "main", + names: Array [ + main, ], - "origins": Array [ + origins: Array [ Object { - "loc": "main", - "module": "", - "moduleId": undefined, - "moduleIdentifier": "", - "moduleName": "", - "request": "./fixtures/abc-query", + loc: main, + module: , + moduleId: undefined, + moduleIdentifier: , + moduleName: , + request: ./fixtures/abc-query, }, ], - "parents": Array [], - "reason": undefined, - "rendered": true, - "runtime": Array [ - "main", + parents: Array [], + reason: undefined, + rendered: true, + runtime: Array [ + main, ], - "siblings": Array [], - "size": 281, - "sizes": Object { - "javascript": 281, + siblings: Array [], + size: 281, + sizes: Object { + javascript: 281, }, - "type": "chunk", + type: chunk, }, ], - "entrypoints": Object { - "main": Object { - "assets": Array [ + entrypoints: Object { + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 346, + name: main.js, + size: 346, }, ], - "assetsSize": 346, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "909", - ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + assetsSize: 346, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 909, + ], + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, }, - "env": undefined, - "errors": Array [], - "errorsCount": 0, - "filteredAssets": undefined, - "filteredModules": undefined, - "hash": "e5c3f8bfb19708a3a81e", - "modules": Array [ + env: undefined, + errors: Array [], + errorsCount: 0, + filteredAssets: undefined, + filteredModules: undefined, + hash: e5c3f8bfb19708a3a81e, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": undefined, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/abc-query.js", - "nameForCondition": "/tests/fixtures/abc-query.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/abc-query.js:1:0-31", - "ModuleConcatenation bailout: Module is not an ECMAScript module", - ], - "optional": false, - "orphan": false, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [ - "a", - "c", - ], - "reasons": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: undefined, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 919, + identifier: /tests/fixtures/abc-query.js, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/abc-query.js, + nameForCondition: /tests/fixtures/abc-query.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/abc-query.js-31, + ModuleConcatenation bailout: Module is not an ECMAScript module, + ], + optional: false, + orphan: false, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [ + a, + c, + ], + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "entry", - "userRequest": "./fixtures/abc-query", + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/abc-query, }, ], - "size": 99, - "sizes": Object { - "javascript": 99, + size: 99, + sizes: Object { + javascript: 99, }, - "source": "exports.a = require(\\"./a?a=1\\"); -// exports.b = require(\\"./b?b=2\\"); -exports.c = require(\\"./c?c=3\\"); -", - "type": "module", - "usedExports": Array [], - "warnings": 0, + source: exports.a = require("./a?a=1"); +// exports.b = require("./b?b=2"); +exports.c = require("./c?c=3");, + type: module, + usedExports: Array [], + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "958", - "identifier": "/tests/fixtures/a.js?a=1", - "index": 1, - "index2": 0, - "issuer": "/tests/fixtures/abc-query.js", - "issuerId": "919", - "issuerName": "./fixtures/abc-query.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 958, + identifier: /tests/fixtures/a.js?a=1, + index: 1, + index2: 0, + issuer: /tests/fixtures/abc-query.js, + issuerId: 919, + issuerName: ./fixtures/abc-query.js, + issuerPath: Array [ Object { - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "name": "./fixtures/abc-query.js", + id: 919, + identifier: /tests/fixtures/abc-query.js, + name: ./fixtures/abc-query.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/a.js?a=1", - "nameForCondition": "/tests/fixtures/a.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/a.js?a=1:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", - ], - "optional": false, - "orphan": false, - "postOrderIndex": 0, - "preOrderIndex": 1, - "providedExports": Array [], - "reasons": Array [ + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/a.js?a=1, + nameForCondition: /tests/fixtures/a.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/a.js?a=1, + ModuleConcatenation bailout: Module is not an ECMAScript module, + ], + optional: false, + orphan: false, + postOrderIndex: 0, + preOrderIndex: 1, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": "958", - "moduleIdentifier": "/tests/fixtures/a.js?a=1", - "moduleName": "./fixtures/a.js?a=1", - "resolvedModule": "./fixtures/a.js?a=1", - "resolvedModuleId": "958", - "resolvedModuleIdentifier": "/tests/fixtures/a.js?a=1", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 958, + moduleIdentifier: /tests/fixtures/a.js?a=1, + moduleName: ./fixtures/a.js?a=1, + resolvedModule: ./fixtures/a.js?a=1, + resolvedModuleId: 958, + resolvedModuleIdentifier: /tests/fixtures/a.js?a=1, + type: cjs self exports reference, + userRequest: self, }, Object { - "moduleId": "919", - "moduleIdentifier": "/tests/fixtures/abc-query.js", - "moduleName": "./fixtures/abc-query.js", - "resolvedModule": "./fixtures/abc-query.js", - "resolvedModuleId": "919", - "resolvedModuleIdentifier": "/tests/fixtures/abc-query.js", - "type": "cjs export require", - "userRequest": "./a?a=1", + moduleId: 919, + moduleIdentifier: /tests/fixtures/abc-query.js, + moduleName: ./fixtures/abc-query.js, + resolvedModule: ./fixtures/abc-query.js, + resolvedModuleId: 919, + resolvedModuleIdentifier: /tests/fixtures/abc-query.js, + type: cjs export require, + userRequest: ./a?a=1, }, ], - "size": 55, - "sizes": Object { - "javascript": 55, + size: 55, + sizes: Object { + javascript: 55, }, - "source": "module.exports = function a() { - return \\"This is a\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function a() { + return "This is a"; +};, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "432", - "identifier": "/tests/fixtures/c.js?c=3", - "index": 2, - "index2": 2, - "issuer": "/tests/fixtures/abc-query.js", - "issuerId": "919", - "issuerName": "./fixtures/abc-query.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 432, + identifier: /tests/fixtures/c.js?c=3, + index: 2, + index2: 2, + issuer: /tests/fixtures/abc-query.js, + issuerId: 919, + issuerName: ./fixtures/abc-query.js, + issuerPath: Array [ Object { - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "name": "./fixtures/abc-query.js", + id: 919, + identifier: /tests/fixtures/abc-query.js, + name: ./fixtures/abc-query.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/c.js?c=3", - "nameForCondition": "/tests/fixtures/c.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/c.js?c=3:1:0-4:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", - ], - "optional": false, - "orphan": false, - "postOrderIndex": 2, - "preOrderIndex": 2, - "providedExports": Array [], - "reasons": Array [ + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/c.js?c=3, + nameForCondition: /tests/fixtures/c.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/c.js?c=3, + ModuleConcatenation bailout: Module is not an ECMAScript module, + ], + optional: false, + orphan: false, + postOrderIndex: 2, + preOrderIndex: 2, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": "919", - "moduleIdentifier": "/tests/fixtures/abc-query.js", - "moduleName": "./fixtures/abc-query.js", - "resolvedModule": "./fixtures/abc-query.js", - "resolvedModuleId": "919", - "resolvedModuleIdentifier": "/tests/fixtures/abc-query.js", - "type": "cjs export require", - "userRequest": "./c?c=3", + moduleId: 919, + moduleIdentifier: /tests/fixtures/abc-query.js, + moduleName: ./fixtures/abc-query.js, + resolvedModule: ./fixtures/abc-query.js, + resolvedModuleId: 919, + resolvedModuleIdentifier: /tests/fixtures/abc-query.js, + type: cjs export require, + userRequest: ./c?c=3, }, Object { - "moduleId": "432", - "moduleIdentifier": "/tests/fixtures/c.js?c=3", - "moduleName": "./fixtures/c.js?c=3", - "resolvedModule": "./fixtures/c.js?c=3", - "resolvedModuleId": "432", - "resolvedModuleIdentifier": "/tests/fixtures/c.js?c=3", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 432, + moduleIdentifier: /tests/fixtures/c.js?c=3, + moduleName: ./fixtures/c.js?c=3, + resolvedModule: ./fixtures/c.js?c=3, + resolvedModuleId: 432, + resolvedModuleIdentifier: /tests/fixtures/c.js?c=3, + type: cjs self exports reference, + userRequest: self, }, ], - "size": 72, - "sizes": Object { - "javascript": 72, + size: 72, + sizes: Object { + javascript: 72, }, - "source": "module.exports = function b() { - require(\\"./a\\"); - return \\"This is c\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function b() { + require("./a"); + return "This is c"; +};, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", - ], - "codeGenerated": true, - "dependent": undefined, - "depth": 2, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "585", - "identifier": "/tests/fixtures/a.js", - "index": 3, - "index2": 1, - "issuer": "/tests/fixtures/c.js?c=3", - "issuerId": "432", - "issuerName": "./fixtures/c.js?c=3", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, + ], + codeGenerated: true, + dependent: undefined, + depth: 2, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 585, + identifier: /tests/fixtures/a.js, + index: 3, + index2: 1, + issuer: /tests/fixtures/c.js?c=3, + issuerId: 432, + issuerName: ./fixtures/c.js?c=3, + issuerPath: Array [ Object { - "id": "919", - "identifier": "/tests/fixtures/abc-query.js", - "name": "./fixtures/abc-query.js", + id: 919, + identifier: /tests/fixtures/abc-query.js, + name: ./fixtures/abc-query.js, }, Object { - "id": "432", - "identifier": "/tests/fixtures/c.js?c=3", - "name": "./fixtures/c.js?c=3", + id: 432, + identifier: /tests/fixtures/c.js?c=3, + name: ./fixtures/c.js?c=3, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/a.js", - "nameForCondition": "/tests/fixtures/a.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/a.js:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", - ], - "optional": false, - "orphan": false, - "postOrderIndex": 1, - "preOrderIndex": 3, - "providedExports": Array [], - "reasons": Array [ + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/a.js, + nameForCondition: /tests/fixtures/a.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/a.js, + ModuleConcatenation bailout: Module is not an ECMAScript module, + ], + optional: false, + orphan: false, + postOrderIndex: 1, + preOrderIndex: 3, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": "585", - "moduleIdentifier": "/tests/fixtures/a.js", - "moduleName": "./fixtures/a.js", - "resolvedModule": "./fixtures/a.js", - "resolvedModuleId": "585", - "resolvedModuleIdentifier": "/tests/fixtures/a.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 585, + moduleIdentifier: /tests/fixtures/a.js, + moduleName: ./fixtures/a.js, + resolvedModule: ./fixtures/a.js, + resolvedModuleId: 585, + resolvedModuleIdentifier: /tests/fixtures/a.js, + type: cjs self exports reference, + userRequest: self, }, Object { - "moduleId": "432", - "moduleIdentifier": "/tests/fixtures/c.js?c=3", - "moduleName": "./fixtures/c.js?c=3", - "resolvedModule": "./fixtures/c.js?c=3", - "resolvedModuleId": "432", - "resolvedModuleIdentifier": "/tests/fixtures/c.js?c=3", - "type": "cjs require", - "userRequest": "./a", + moduleId: 432, + moduleIdentifier: /tests/fixtures/c.js?c=3, + moduleName: ./fixtures/c.js?c=3, + resolvedModule: ./fixtures/c.js?c=3, + resolvedModuleId: 432, + resolvedModuleIdentifier: /tests/fixtures/c.js?c=3, + type: cjs require, + userRequest: ./a, }, ], - "size": 55, - "sizes": Object { - "javascript": 55, + size: 55, + sizes: Object { + javascript: 55, }, - "source": "module.exports = function a() { - return \\"This is a\\"; -};", - "type": "module", - "usedExports": null, - "warnings": 0, + source: module.exports = function a() { + return "This is a"; +};, + type: module, + usedExports: null, + warnings: 0, }, ], - "namedChunkGroups": Object { - "main": Object { - "assets": Array [ + namedChunkGroups: Object { + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 346, + name: main.js, + size: 346, }, ], - "assetsSize": 346, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "909", - ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + assetsSize: 346, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 909, + ], + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, }, - "outputPath": "/dist", - "publicPath": "auto", - "warnings": Array [], - "warningsCount": 0, + outputPath: /dist, + publicPath: auto, + warnings: Array [], + warningsCount: 0, } `; diff --git a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap index b971ad7b072..87568d05ac2 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsOutput.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`statsOutput statsOutput/auxiliary-files-test should print correct stats for 1`] = ` -"PublicPath: auto +PublicPath: auto asset bundle.js 2.6 KiB {909} [emitted] (name: main) asset 2710c5e36f8babb0a3a4.png 7 bytes ({909}) [emitted] [immutable] [from: raw.png] (auxiliary name: main) Entrypoint main 2.6 KiB (7 bytes) = bundle.js 2.6 KiB (2710c5e36f8babb0a3a4.png 7 bytes) @@ -59,14 +59,14 @@ runtime modules 1.61 KiB [no exports] [used exports unknown] -Rspack compiled successfully (75a3437c65e54d5331bb)" +Rspack compiled successfully (75a3437c65e54d5331bb) `; exports[`statsOutput statsOutput/builtin-swc-loader-parse-error should print correct stats for 1`] = ` -"ERROR in ./index.ts +ERROR in ./index.ts × Module build failed: ├─▶ × x Expected '{', got 'error' - │ │ ,-[Xdir/builtin-swc-loader-parse-error/index.ts:1:1] + │ │ ,-[/tests/statsOutputCases/builtin-swc-loader-parse-error/index.ts] │ │ 1 | export error; │ │ : ^^^^^ │ │ \`---- @@ -74,59 +74,59 @@ exports[`statsOutput statsOutput/builtin-swc-loader-parse-error should print cor │ ╰─▶ Syntax Error -Rspack compiled with 1 error" +Rspack compiled with 1 error `; exports[`statsOutput statsOutput/concatenated-modules should print correct stats for 1`] = ` -"asset main.js 234 bytes [emitted] (name: main) +asset main.js 234 bytes [emitted] (name: main) orphan modules 141 bytes [orphan] 4 modules ./index.js + 3 modules 141 bytes [code generated] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/css-concat should print correct stats for 1`] = ` -"asset main.js 7.81 KiB [emitted] (name: main) +asset main.js 7.81 KiB [emitted] (name: main) asset main.css 51 bytes [emitted] (name: main) Entrypoint main 7.86 KiB = main.js 7.81 KiB main.css 51 bytes runtime modules 6.47 KiB 6 modules cacheable modules 20 bytes (javascript) 23 bytes (css) ./index.js 20 bytes [built] [code generated] ./foo.css 23 bytes [built] [code generated] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/filename should print correct stats for 1`] = ` -"asset 909.xxxx.js 9.14 KiB [emitted] (name: main) +asset 909.xxxx.js 9.14 KiB [emitted] (name: main) asset 521.xxxx.js 337 bytes [emitted] runtime modules 7.54 KiB 11 modules cacheable modules 70 bytes ./index.js 38 bytes [built] [code generated] ./dynamic.js 32 bytes [built] [code generated] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/hot+production should print correct stats for 1`] = ` -"asset main.js 35.5 KiB [emitted] (name: main) +asset main.js 35.5 KiB [emitted] (name: main) runtime modules 33.1 KiB 12 modules ./index.js 25 bytes [built] [code generated] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/ignore-plugin should print correct stats for 1`] = ` -"runtime modules 107 bytes 1 module +runtime modules 107 bytes 1 module ./index.js 103 bytes [built] [code generated] -Xdir/ignore-plugin/locals|sync|/^\\\\.\\\\/.*$/ 160 bytes [built] [code generated] -./locals/en.js 30 bytes [built] [code generated]" +/tests/statsOutputCases/ignore-plugin/locals|sync|/^/.//.*$/ 160 bytes [built] [code generated] +./locals/en.js 30 bytes [built] [code generated] `; -exports[`statsOutput statsOutput/ignore-warning should print correct stats for 1`] = `"Rspack compiled successfully"`; +exports[`statsOutput statsOutput/ignore-warning should print correct stats for 1`] = `Rspack compiled successfully`; -exports[`statsOutput statsOutput/issue-3558 should print correct stats for 1`] = `"Rspack compiled successfully"`; +exports[`statsOutput statsOutput/issue-3558 should print correct stats for 1`] = `Rspack compiled successfully`; -exports[`statsOutput statsOutput/legacy-ie-css-warning should print correct stats for 1`] = `"Rspack compiled successfully"`; +exports[`statsOutput statsOutput/legacy-ie-css-warning should print correct stats for 1`] = `Rspack compiled successfully`; exports[`statsOutput statsOutput/let-keyword-as-variable-name-error should print correct stats for 1`] = ` -"ERROR in ./index.js +ERROR in ./index.js × Module parse failed: ╰─▶ × JavaScript parsing error: Unexpected token \`let\`. Expected let is reserved in const, let, class declaration ╭──── @@ -137,11 +137,11 @@ exports[`statsOutput statsOutput/let-keyword-as-variable-name-error should print help: You may need an appropriate loader to handle this file type. -Rspack compiled with 1 error" +Rspack compiled with 1 error `; exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct stats for 1`] = ` -"1 chunks: +1 chunks: asset bundle1.js 3.54 KiB [emitted] (name: main) chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.84 KiB (runtime) <{909}> >{909}< [entry] [rendered] dependent modules 96 bytes [dependent] 4 modules @@ -187,26 +187,25 @@ exports[`statsOutput statsOutput/limit-chunk-count-plugin should print correct s chunk (runtime: main) bundle4.js (main) 145 bytes (javascript) 8.73 KiB (runtime) >{76}< [entry] [rendered] dependent modules 22 bytes [dependent] 1 module ./index.js 123 bytes [built] [code generated] - 4 chunks (Rspack x.x.x) compiled successfully in X s" + 4 chunks (Rspack x.x.x) compiled successfully in X s `; exports[`statsOutput statsOutput/logging-loader should print correct stats for 1`] = ` -"DEBUG LOG from TestLoader|Xdir/logging-loader/index.js +DEBUG LOG from TestLoader|/tests/statsOutputCases/logging-loader/index.js <-> group info something log something ------- -" `; exports[`statsOutput statsOutput/match-resource-data-url should print correct stats for 1`] = ` -"runtime modules 677 bytes 3 modules +runtime modules 677 bytes 3 modules ./index.js 150 bytes [built] [code generated] -./a.js!=!data:javascript,var __looooooooo.. 98 bytes [built] [code generated]" +./a.js!=!data:javascript,var __looooooooo.. 98 bytes [built] [code generated] `; exports[`statsOutput statsOutput/minify-error should print correct stats for 1`] = ` -"ERROR in × JavaScript parsing error: Expected a semicolon +ERROR in × JavaScript parsing error: Expected a semicolon ╭─[1:8] 1 │ const a {} · ─ @@ -214,72 +213,72 @@ exports[`statsOutput statsOutput/minify-error should print correct stats for 1`] 3 │ console.log(0); ╰──── -Rspack compiled with 1 error" +Rspack compiled with 1 error `; exports[`statsOutput statsOutput/named-chunk-group should print correct stats for 1`] = ` -"Entrypoint main 9.13 KiB = main.js -Chunk Group cimanyd 337 bytes = cimanyd.js" +Entrypoint main 9.13 KiB = main.js +Chunk Group cimanyd 337 bytes = cimanyd.js `; exports[`statsOutput statsOutput/nonexistent-import-source-error should print correct stats for 1`] = ` -"ERROR in ./index.js 1:0-19 - × Module not found: Can't resolve 'not-exist' in 'Xdir/nonexistent-import-source-error' +ERROR in ./index.js 1:0-19 + × Module not found: Can't resolve 'not-exist' in '/tests/statsOutputCases/nonexistent-import-source-error' ╭──── - 1 │ import \\"not-exist\\"; + 1 │ import "not-exist"; · ─────────── ╰──── -Rspack compiled with 1 error" +Rspack compiled with 1 error `; exports[`statsOutput statsOutput/optimization-chunk-ids-natural should print correct stats for 1`] = ` -"Entrypoint e1 10.7 KiB = e1.js +Entrypoint e1 10.7 KiB = e1.js Entrypoint e2 10.6 KiB = e2.js chunk (runtime: e1) 0.js 24 bytes [rendered] chunk (runtime: e1) 1.js 52 bytes [rendered] chunk (runtime: e1, e2) 2.js 22 bytes [rendered] chunk (runtime: e1) e1.js (e1) 74 bytes (javascript) 8.72 KiB (runtime) [entry] [rendered] -chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.72 KiB (runtime) [entry] [rendered]" +chunk (runtime: e2) e2.js (e2) 51 bytes (javascript) 8.72 KiB (runtime) [entry] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk should print correct stats for 1`] = ` -"Entrypoint e1 4.07 KiB = e1~runtime.js 3.68 KiB e1.js 391 bytes +Entrypoint e1 4.07 KiB = e1~runtime.js 3.68 KiB e1.js 391 bytes Entrypoint e2 4.07 KiB = e2~runtime.js 3.68 KiB e2.js 391 bytes chunk (runtime: e1~runtime) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: e1~runtime) e1~runtime.js (e1~runtime) 2.58 KiB [initial] [rendered] chunk (runtime: e2~runtime) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: e2~runtime) e2~runtime.js (e2~runtime) 2.58 KiB [initial] [rendered]" +chunk (runtime: e2~runtime) e2~runtime.js (e2~runtime) 2.58 KiB [initial] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk-multiple should print correct stats for 1`] = ` -"Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes +Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes Entrypoint e2 4.07 KiB = runtime~e2.js 3.68 KiB e2.js 391 bytes chunk (runtime: runtime~e1) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime~e2) e2.js (e2) 27 bytes [entry] [rendered] chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) 2.58 KiB [initial] [rendered] -chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered]" +chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk-single should print correct stats for 1`] = ` -"Entrypoint e1 4.06 KiB = runtime.js 3.68 KiB e1.js 391 bytes +Entrypoint e1 4.06 KiB = runtime.js 3.68 KiB e1.js 391 bytes Entrypoint e2 4.06 KiB = runtime.js 3.68 KiB e2.js 391 bytes chunk (runtime: runtime) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime) e2.js (e2) 27 bytes [entry] [rendered] -chunk (runtime: runtime) runtime.js (runtime) 2.58 KiB [initial] [rendered]" +chunk (runtime: runtime) runtime.js (runtime) 2.58 KiB [initial] [rendered] `; exports[`statsOutput statsOutput/optimization-runtime-chunk-true should print correct stats for 1`] = ` -"Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes +Entrypoint e1 4.07 KiB = runtime~e1.js 3.68 KiB e1.js 391 bytes Entrypoint e2 4.07 KiB = runtime~e2.js 3.68 KiB e2.js 391 bytes chunk (runtime: runtime~e1) e1.js (e1) 27 bytes [entry] [rendered] chunk (runtime: runtime~e2) e2.js (e2) 27 bytes [entry] [rendered] chunk (runtime: runtime~e1) runtime~e1.js (runtime~e1) 2.58 KiB [initial] [rendered] -chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered]" +chunk (runtime: runtime~e2) runtime~e2.js (runtime~e2) 2.58 KiB [initial] [rendered] `; exports[`statsOutput statsOutput/parse-error should print correct stats for 1`] = ` -"ERROR in ./b.js +ERROR in ./b.js × Module parse failed: ╰─▶ × JavaScript parsing error: Expected ';', '}' or ╭─[6:7] @@ -294,11 +293,11 @@ exports[`statsOutput statsOutput/parse-error should print correct stats for 1`] help: You may need an appropriate loader to handle this file type. -Rspack compiled with 1 error" +Rspack compiled with 1 error `; exports[`statsOutput statsOutput/performance-disabled should print correct stats for 1`] = ` -"asset main.js 304 KiB [emitted] (name: main) +asset main.js 304 KiB [emitted] (name: main) asset 697.js 130 bytes [emitted] asset 753.js 130 bytes [emitted] Entrypoint main 304 KiB = main.js @@ -310,11 +309,11 @@ cacheable modules 293 KiB ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] ./e.js 22 bytes [built] [code generated] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/performance-error should print correct stats for 1`] = ` -"asset main.js 304 KiB [emitted] [big] (name: main) +asset main.js 304 KiB [emitted] [big] (name: main) asset 697.js 130 bytes [emitted] asset 753.js 130 bytes [emitted] Entrypoint main [big] 304 KiB = main.js @@ -336,11 +335,11 @@ ERROR in × entrypoint size limit: The following entrypoint(s) combined asset si │ main.js -Rspack x.x.x compiled with 2 errors in X s" +Rspack x.x.x compiled with 2 errors in X s `; exports[`statsOutput statsOutput/performance-no-hints should print correct stats for 1`] = ` -"asset main.js 304 KiB [emitted] [big] (name: main) +asset main.js 304 KiB [emitted] [big] (name: main) asset 697.js 130 bytes [emitted] asset 753.js 130 bytes [emitted] Entrypoint main [big] 304 KiB = main.js @@ -352,11 +351,11 @@ cacheable modules 293 KiB ./c.js 28 bytes [built] [code generated] ./d.js 22 bytes [built] [code generated] ./e.js 22 bytes [built] [code generated] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/prefetch-preload-mixed should print correct stats for 1`] = ` -"chunk (runtime: main) a1.js (a1) 1 bytes <{74}> [rendered] +chunk (runtime: main) a1.js (a1) 1 bytes <{74}> [rendered] chunk (runtime: main) c2.js (c2) 1 bytes <{76}> [rendered] chunk (runtime: main) c1.js (c1) 1 bytes <{76}> [rendered] chunk (runtime: main) b3.js (b3) 1 bytes <{751}> [rendered] @@ -366,53 +365,53 @@ chunk (runtime: main) a2.js (a2) 1 bytes <{74}> [rendered] chunk (runtime: main) b.js (b) 203 bytes <{909}> >{438}< >{439}< >{826}< (prefetch: {826} {438}) (preload: {439}) [rendered] chunk (runtime: main) c.js (c) 134 bytes <{909}> >{380}< >{433}< (preload: {433} {380}) [rendered] chunk (runtime: main) b1.js (b1) 1 bytes <{751}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 12 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered]" +chunk (runtime: main) main.js (main) 195 bytes (javascript) 12 KiB (runtime) >{74}< >{751}< >{76}< (prefetch: {74} {751} {76}) [entry] [rendered] `; exports[`statsOutput statsOutput/reasons should print correct stats for 1`] = ` -"./index.js 44 bytes [built] [code generated] +./index.js 44 bytes [built] [code generated] entry ./index ./a.js 55 bytes [built] [code generated] cjs self exports reference self ./a.js - cjs require ./a ./index.js" + cjs require ./a ./index.js `; exports[`statsOutput statsOutput/resolve-overflow-error should print correct stats for 1`] = ` -"assets by status 348 bytes [cached] 1 asset +assets by status 348 bytes [cached] 1 asset ./index.js 51 bytes [built] [code generated] [1 error] ERROR in ./index.js 1:0-34 - × Module not found: Can't resolve 'cycle-alias/a' in 'Xdir/resolve-overflow-error' + × Module not found: Can't resolve 'cycle-alias/a' in '/tests/statsOutputCases/resolve-overflow-error' ╭─[1:18] - 1 │ import { a } from \\"cycle-alias/a\\"; + 1 │ import { a } from "cycle-alias/a"; · ─────────────── 2 │ console.log(a); ╰──── help: maybe it had cyclic aliases -Rspack x.x.x compiled with 1 error in X s" +Rspack x.x.x compiled with 1 error in X s `; exports[`statsOutput statsOutput/resolve-unexpected-exports-in-pkg-error should print correct stats for 1`] = ` -"asset bundle.js 1.38 KiB [emitted] (name: main) +asset bundle.js 1.38 KiB [emitted] (name: main) runtime modules 280 bytes 1 module ./index.js 39 bytes [built] [code generated] [1 error] ERROR in ./index.js 1:0-22 - × Invalid \\"exports\\" target \\"../../index.js\\" defined for '.' in the package config Xdir/resolve-unexpected-exports-in-pkg-error/node_modules/pkg-a/package.json + × Invalid "exports" target "../../index.js" defined for '.' in the package config /tests/statsOutputCases/resolve-unexpected-exports-in-pkg-error/node_modules/pkg-a/package.json -Rspack x.x.x compiled with 1 error in X s" +Rspack x.x.x compiled with 1 error in X s `; exports[`statsOutput statsOutput/runtime-modules should print correct stats for 1`] = ` -"./index.js 19 bytes [built] [code generated] +./index.js 19 bytes [built] [code generated] webpack/runtime/define_property_getters 290 bytes [code generated] webpack/runtime/has_own_property 107 bytes [code generated] -webpack/runtime/make_namespace_object 280 bytes [code generated]" +webpack/runtime/make_namespace_object 280 bytes [code generated] `; exports[`statsOutput statsOutput/runtime-specific-exports should print correct stats for 1`] = ` -"asset main.js 1.67 KiB [emitted] (name: main) +asset main.js 1.67 KiB [emitted] (name: main) ./example.js 70 bytes [built] [code generated] [no exports] [no exports used] @@ -422,11 +421,11 @@ exports[`statsOutput statsOutput/runtime-specific-exports should print correct s ./math.js 313 bytes [built] [code generated] [exports: add, multiply] [only some exports used: add] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/side-effects-bailouts should print correct stats for 1`] = ` -"asset main.js 177 bytes {909} [emitted] (name: main) +asset main.js 177 bytes {909} [emitted] (name: main) chunk {909} (runtime: main) main.js (main) 91 bytes [entry] [rendered] orphan modules 91 bytes [orphan] 2 modules ./index.js + 1 modules [911] 91 bytes {909} [code generated] @@ -434,35 +433,35 @@ orphan modules 91 bytes [orphan] 2 modules [no exports used] entry ./index.js -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/simple-export should print correct stats for 1`] = ` -"asset bundle.js 1.71 KiB [emitted] (name: main) +asset bundle.js 1.71 KiB [emitted] (name: main) runtime modules 677 bytes 3 modules ./index.js 26 bytes [built] [code generated] -Rspack x.x.x compiled successfully in X s" +Rspack x.x.x compiled successfully in X s `; exports[`statsOutput statsOutput/simple-module-source should print correct stats for 1`] = ` -"asset bundle.js 2.07 KiB [emitted] (name: main) +asset bundle.js 2.07 KiB [emitted] (name: main) runtime modules 706 bytes 3 modules orphan modules 1 bytes [orphan] 1 module cacheable modules 82 bytes ./index.js 75 bytes [built] [code generated] ./raw.png 7 bytes [built] [code generated] -Rspack compiled successfully" +Rspack compiled successfully `; exports[`statsOutput statsOutput/stats-hooks should print correct stats for 1`] = ` -"asset main.js 69 bytes [emitted111] (name: main) [testA: aaaaaa] +asset main.js 69 bytes [emitted111] (name: main) [testA: aaaaaa] ./index.js 26 bytes [built] [code generated] -Rspack compiled successfully" +Rspack compiled successfully `; exports[`statsOutput statsOutput/try-require-module should print correct stats for 1`] = ` -"WARNING in ./index.js - ⚠ Module not found: Can't resolve './missing-module' in 'Xdir/try-require-module' +WARNING in ./index.js + ⚠ Module not found: Can't resolve './missing-module' in '/tests/statsOutputCases/try-require-module' ╭─[2:4] 1 │ try { 2 │ require('./missing-module') @@ -471,12 +470,12 @@ exports[`statsOutput statsOutput/try-require-module should print correct stats f 4 │ ╰──── -Rspack compiled with 1 warning" +Rspack compiled with 1 warning `; exports[`statsOutput statsOutput/try-require-resolve-module should print correct stats for 1`] = ` -"WARNING in ./index.js - ⚠ Module not found: Can't resolve './missing-module' in 'Xdir/try-require-resolve-module' +WARNING in ./index.js + ⚠ Module not found: Can't resolve './missing-module' in '/tests/statsOutputCases/try-require-resolve-module' ╭─[2:20] 1 │ try { 2 │ require.resolve('./missing-module') @@ -485,12 +484,12 @@ exports[`statsOutput statsOutput/try-require-resolve-module should print correct 4 │ ╰──── -Rspack compiled with 1 warning" +Rspack compiled with 1 warning `; exports[`statsOutput statsOutput/try-require-resolve-weak-module should print correct stats for 1`] = ` -"WARNING in ./index.js - ⚠ Module not found: Can't resolve './missing-module' in 'Xdir/try-require-resolve-weak-module' +WARNING in ./index.js + ⚠ Module not found: Can't resolve './missing-module' in '/tests/statsOutputCases/try-require-resolve-weak-module' ╭─[2:24] 1 │ try { 2 │ require.resolveWeak('./missing-module') @@ -499,5 +498,5 @@ exports[`statsOutput statsOutput/try-require-resolve-weak-module should print co 4 │ ╰──── -Rspack compiled with 1 warning" +Rspack compiled with 1 warning `; diff --git a/packages/rspack-test-tools/tests/compilerCases/assets-exist.js b/packages/rspack-test-tools/tests/compilerCases/assets-exist.js index 835ea33b16f..0a649f48ef0 100644 --- a/packages/rspack-test-tools/tests/compilerCases/assets-exist.js +++ b/packages/rspack-test-tools/tests/compilerCases/assets-exist.js @@ -23,9 +23,8 @@ module.exports = { }; }, async check(_, __, stats) { - expect(stats.toJson().errors[0].message).toMatchInlineSnapshot(` - " × Conflict: Multiple assets emit different content to the same filename main.js - " - `); + expect(stats.toJson().errors[0].message).toMatchInlineSnapshot( + `× Conflict: Multiple assets emit different content to the same filename main.js` + ); } }; diff --git a/packages/rspack-test-tools/tests/compilerCases/assets-not-exist.js b/packages/rspack-test-tools/tests/compilerCases/assets-not-exist.js index f1d409c4208..7745222c556 100644 --- a/packages/rspack-test-tools/tests/compilerCases/assets-not-exist.js +++ b/packages/rspack-test-tools/tests/compilerCases/assets-not-exist.js @@ -18,8 +18,8 @@ class MyPlugin { ); } catch (err) { mockFn(); - expect(err).toMatchInlineSnapshot( - `[Error: Called Compilation.updateAsset for not existing filename something-else.js]` + expect(err.toString()).toMatchInlineSnapshot( + `Error: Called Compilation.updateAsset for not existing filename something-else.js` ); } }); diff --git a/packages/rspack-test-tools/tests/compilerCases/single-file.js b/packages/rspack-test-tools/tests/compilerCases/single-file.js index 3dd969a54b3..c44a3b768f4 100644 --- a/packages/rspack-test-tools/tests/compilerCases/single-file.js +++ b/packages/rspack-test-tools/tests/compilerCases/single-file.js @@ -36,16 +36,15 @@ module.exports = { async check() { expect(error).toBeTruthy(); expect(error.toString()).toMatchInlineSnapshot(` - "Error: × Empty dependency: Expected a non-empty request + Error: × Empty dependency: Expected a non-empty request ╭─[3:4] 1 │ module.exports = function b() { 2 │ /* eslint-disable node/no-missing-require */ - 3 │ require(\\"\\"); + 3 │ require(""); · ─────────── - 4 │ return \\"This is an empty dependency\\"; + 4 │ return "This is an empty dependency"; 5 │ }; ╰──── - " `); } }; diff --git a/packages/rspack-test-tools/tests/defaultsCases/config/array-defaults.js b/packages/rspack-test-tools/tests/defaultsCases/config/array-defaults.js index 928770235ce..dfb07e260f9 100644 --- a/packages/rspack-test-tools/tests/defaultsCases/config/array-defaults.js +++ b/packages/rspack-test-tools/tests/defaultsCases/config/array-defaults.js @@ -9,12 +9,12 @@ module.exports = { }), diff: e => e.toMatchInlineSnapshot(` - - Expected - + Received + - Expected + + Received - @@ ... @@ - + "require", - @@ ... @@ - + "async-node", - `) + @@ ... @@ + + "require", + @@ ... @@ + + "async-node", + `) }; diff --git a/packages/rspack-test-tools/tests/defaultsCases/experiments/async-wasm.js b/packages/rspack-test-tools/tests/defaultsCases/experiments/async-wasm.js index bd02a28f9a6..6683f0bac93 100644 --- a/packages/rspack-test-tools/tests/defaultsCases/experiments/async-wasm.js +++ b/packages/rspack-test-tools/tests/defaultsCases/experiments/async-wasm.js @@ -23,7 +23,7 @@ module.exports = { + }, + }, + ], - + "test": /\\.wasm$/i, + + "test": //.wasm$/i, + "type": "webassembly/async", + }, + Object { diff --git a/packages/rspack-test-tools/tests/defaultsCases/experiments/both-wasm.js b/packages/rspack-test-tools/tests/defaultsCases/experiments/both-wasm.js index 9bee2971b6b..6fb0caea3cc 100644 --- a/packages/rspack-test-tools/tests/defaultsCases/experiments/both-wasm.js +++ b/packages/rspack-test-tools/tests/defaultsCases/experiments/both-wasm.js @@ -27,7 +27,7 @@ module.exports = { + }, + }, + ], - + "test": /\\.wasm$/i, + + "test": //.wasm$/i, + "type": "webassembly/async", + }, + Object { diff --git a/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults-with-css.js b/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults-with-css.js index ac920b53d31..a31a9d57705 100644 --- a/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults-with-css.js +++ b/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults-with-css.js @@ -32,7 +32,7 @@ module.exports = { + }, + }, + ], - + "test": /\\.wasm$/i, + + "test": //.wasm$/i, + "type": "webassembly/async", @@ ... @@ + "mimetype": "application/wasm", diff --git a/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults.js b/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults.js index 1087c1b708e..48d7e46f1fd 100644 --- a/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults.js +++ b/packages/rspack-test-tools/tests/defaultsCases/experiments/future-defaults.js @@ -31,7 +31,7 @@ module.exports = { + }, + }, + ], - + "test": /\\.wasm$/i, + + "test": //.wasm$/i, + "type": "webassembly/async", @@ ... @@ + Object { @@ -53,7 +53,7 @@ module.exports = { + "fullySpecified": true, + "preferRelative": true, + }, - + "test": /\\.css$/i, + + "test": //.css$/i, + "type": "css/auto", + }, + Object { diff --git a/packages/rspack-test-tools/tests/defaultsCases/library/name-root-placeholder.js b/packages/rspack-test-tools/tests/defaultsCases/library/name-root-placeholder.js index 56b3d922268..a55568ea621 100644 --- a/packages/rspack-test-tools/tests/defaultsCases/library/name-root-placeholder.js +++ b/packages/rspack-test-tools/tests/defaultsCases/library/name-root-placeholder.js @@ -41,9 +41,9 @@ module.exports = { + "export": undefined, + "name": Object { + "root": Array [ - + "[\\\\name\\\\]", - + "my[\\\\name\\\\]Lib[name]", - + "[\\\\name\\\\]", + + "[/name/]", + + "my[/name/]Lib[name]", + + "[/name/]", + ], + }, + "type": "var", diff --git a/packages/rspack-test-tools/tests/errorCases/error-map.js b/packages/rspack-test-tools/tests/errorCases/error-map.js index 19d4ea5590e..56bf7fa1127 100644 --- a/packages/rspack-test-tools/tests/errorCases/error-map.js +++ b/packages/rspack-test-tools/tests/errorCases/error-map.js @@ -25,8 +25,8 @@ module.exports = { Object { "index": 0, "loc": "1:0-33", - "message": " × Module not found: Can't resolve './answer' in 'packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer'\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n", - "moduleIdentifier": "javascript/esm|packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm/index.js", + "message": " × Module not found: Can't resolve './answer' in '/tests/fixtures/errors/resolve-fail-esm'/n ╭────/n 1 │ import { answer } from './answer'/n · ──────────/n ╰────/n help: Did you mean './answer.js'?/n /n The request './answer' failed to resolve only because it was resolved as fully specified,/n probably because the origin is strict EcmaScript Module,/n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '/"type/": /"module/"'./n /n The extension in the request is mandatory for it to be fully specified./n Add the extension to the request./n", + "moduleIdentifier": "javascript/esm|/tests/fixtures/errors/resolve-fail-esm/index.js", "name": "Error", }, ] diff --git a/packages/rspack-test-tools/tests/errorCases/error-test-pop.js b/packages/rspack-test-tools/tests/errorCases/error-test-pop.js index 7d243151c29..86b0a8d1c08 100644 --- a/packages/rspack-test-tools/tests/errorCases/error-test-pop.js +++ b/packages/rspack-test-tools/tests/errorCases/error-test-pop.js @@ -1,24 +1,24 @@ /** @type {import('../..').TErrorCaseConfig} */ module.exports = { - description: "Testing proxy methods on errors: test pop", - options() { - return { - entry: "./resolve-fail-esm", - plugins: [ - compiler => { - compiler.hooks.afterCompile.tap("test pop", compilation => { - compilation.errors.pop(); - }); - } - ] - }; - }, - async check(diagnostics) { - expect(diagnostics).toMatchInlineSnapshot(` - Object { - "errors": Array [], - "warnings": Array [], - } - `); - } + description: "Testing proxy methods on errors: test pop", + options() { + return { + entry: "./resolve-fail-esm", + plugins: [ + compiler => { + compiler.hooks.afterCompile.tap("test pop", compilation => { + compilation.errors.pop(); + }); + } + ] + }; + }, + async check(diagnostics) { + expect(diagnostics).toMatchInlineSnapshot(` + Object { + "errors": Array [], + "warnings": Array [], + } + `); + } }; diff --git a/packages/rspack-test-tools/tests/errorCases/error-test-push.js b/packages/rspack-test-tools/tests/errorCases/error-test-push.js index c54d6d38882..e5d7da0d7d9 100644 --- a/packages/rspack-test-tools/tests/errorCases/error-test-push.js +++ b/packages/rspack-test-tools/tests/errorCases/error-test-push.js @@ -18,15 +18,15 @@ module.exports = { Object { "errors": Array [ Object { - "message": " × Error: test push\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " × Error: test push/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test push\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/error-test-push.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test push/n at Object.fn (/tests/errorCases/error-test-push.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, Object { "loc": "1:0-33", - "message": " × Module not found: Can't resolve './answer' in 'packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer'\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n", + "message": " × Module not found: Can't resolve './answer' in '/tests/fixtures/errors/resolve-fail-esm'/n ╭────/n 1 │ import { answer } from './answer'/n · ──────────/n ╰────/n help: Did you mean './answer.js'?/n /n The request './answer' failed to resolve only because it was resolved as fully specified,/n probably because the origin is strict EcmaScript Module,/n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '/"type/": /"module/"'./n /n The extension in the request is mandatory for it to be fully specified./n Add the extension to the request./n", "moduleId": "./resolve-fail-esm/index.js", - "moduleIdentifier": "javascript/esm|packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm/index.js", + "moduleIdentifier": "javascript/esm|/tests/fixtures/errors/resolve-fail-esm/index.js", "moduleName": "./resolve-fail-esm/index.js", "moduleTrace": Array [], "stack": undefined, diff --git a/packages/rspack-test-tools/tests/errorCases/error-test-shift.js b/packages/rspack-test-tools/tests/errorCases/error-test-shift.js index 0cdb4fcc039..f45a9e34902 100644 --- a/packages/rspack-test-tools/tests/errorCases/error-test-shift.js +++ b/packages/rspack-test-tools/tests/errorCases/error-test-shift.js @@ -22,9 +22,9 @@ module.exports = { Object { "errors": Array [ Object { - "message": " × Error: test unshift\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " × Error: test unshift/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test unshift\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/error-test-shift.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test unshift/n at Object.fn (/tests/errorCases/error-test-shift.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, ], "warnings": Array [], diff --git a/packages/rspack-test-tools/tests/errorCases/error-test-splice-1.js b/packages/rspack-test-tools/tests/errorCases/error-test-splice-1.js index b3fd9adfaa9..47795619054 100644 --- a/packages/rspack-test-tools/tests/errorCases/error-test-splice-1.js +++ b/packages/rspack-test-tools/tests/errorCases/error-test-splice-1.js @@ -18,9 +18,9 @@ module.exports = { Object { "errors": Array [ Object { - "message": " × Error: test splice\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " × Error: test splice/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test splice\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/error-test-splice-1.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test splice/n at Object.fn (/tests/errorCases/error-test-splice-1.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, ], "warnings": Array [], diff --git a/packages/rspack-test-tools/tests/errorCases/error-test-splice-2.js b/packages/rspack-test-tools/tests/errorCases/error-test-splice-2.js index 58ade5376eb..e7fc19354c3 100644 --- a/packages/rspack-test-tools/tests/errorCases/error-test-splice-2.js +++ b/packages/rspack-test-tools/tests/errorCases/error-test-splice-2.js @@ -18,15 +18,15 @@ module.exports = { Object { "errors": Array [ Object { - "message": " × Error: test splice\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " × Error: test splice/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test splice\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/error-test-splice-2.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test splice/n at Object.fn (/tests/errorCases/error-test-splice-2.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, Object { "loc": "1:0-33", - "message": " × Module not found: Can't resolve './answer' in 'packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer'\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n", + "message": " × Module not found: Can't resolve './answer' in '/tests/fixtures/errors/resolve-fail-esm'/n ╭────/n 1 │ import { answer } from './answer'/n · ──────────/n ╰────/n help: Did you mean './answer.js'?/n /n The request './answer' failed to resolve only because it was resolved as fully specified,/n probably because the origin is strict EcmaScript Module,/n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '/"type/": /"module/"'./n /n The extension in the request is mandatory for it to be fully specified./n Add the extension to the request./n", "moduleId": "./resolve-fail-esm/index.js", - "moduleIdentifier": "javascript/esm|packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm/index.js", + "moduleIdentifier": "javascript/esm|/tests/fixtures/errors/resolve-fail-esm/index.js", "moduleName": "./resolve-fail-esm/index.js", "moduleTrace": Array [], "stack": undefined, diff --git a/packages/rspack-test-tools/tests/errorCases/resolve-fail-esm.js b/packages/rspack-test-tools/tests/errorCases/resolve-fail-esm.js index 803ffeb1b13..79c7518c21a 100644 --- a/packages/rspack-test-tools/tests/errorCases/resolve-fail-esm.js +++ b/packages/rspack-test-tools/tests/errorCases/resolve-fail-esm.js @@ -12,9 +12,9 @@ module.exports = { "errors": Array [ Object { "loc": "1:0-33", - "message": " × Module not found: Can't resolve './answer' in 'packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer'\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n", + "message": " × Module not found: Can't resolve './answer' in '/tests/fixtures/errors/resolve-fail-esm'/n ╭────/n 1 │ import { answer } from './answer'/n · ──────────/n ╰────/n help: Did you mean './answer.js'?/n /n The request './answer' failed to resolve only because it was resolved as fully specified,/n probably because the origin is strict EcmaScript Module,/n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '/"type/": /"module/"'./n /n The extension in the request is mandatory for it to be fully specified./n Add the extension to the request./n", "moduleId": "./resolve-fail-esm/index.js", - "moduleIdentifier": "javascript/esm|packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm/index.js", + "moduleIdentifier": "javascript/esm|/tests/fixtures/errors/resolve-fail-esm/index.js", "moduleName": "./resolve-fail-esm/index.js", "moduleTrace": Array [], "stack": undefined, diff --git a/packages/rspack-test-tools/tests/errorCases/warning-map.js b/packages/rspack-test-tools/tests/errorCases/warning-map.js index e9ce81afb35..4eaadfcccfa 100644 --- a/packages/rspack-test-tools/tests/errorCases/warning-map.js +++ b/packages/rspack-test-tools/tests/errorCases/warning-map.js @@ -24,8 +24,8 @@ module.exports = { Array [ Object { "index": 0, - "message": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Unsupported feature: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n", - "moduleIdentifier": "packages/rspack-test-tools/tests/fixtures/errors/require.main.require.js", + "message": " ⚠ Module parse warning:/n ╰─▶ ⚠ Unsupported feature: require.main.require() is not supported by Rspack./n ╭────/n 1 │ require.main.require('./file');/n · ──────────────────────────────/n ╰────/n /n", + "moduleIdentifier": "/tests/fixtures/errors/require.main.require.js", "name": "ModuleParseWarning", }, ] diff --git a/packages/rspack-test-tools/tests/errorCases/warning-test-pop.js b/packages/rspack-test-tools/tests/errorCases/warning-test-pop.js index c4978ca0dfc..ab7772f6543 100644 --- a/packages/rspack-test-tools/tests/errorCases/warning-test-pop.js +++ b/packages/rspack-test-tools/tests/errorCases/warning-test-pop.js @@ -1,24 +1,24 @@ /** @type {import('../..').TErrorCaseConfig} */ module.exports = { - description: "Testing proxy methods on warnings: test pop", - options() { - return { - entry: "./require.main.require", - plugins: [ - compiler => { - compiler.hooks.afterCompile.tap("test pop", compilation => { - compilation.warnings.pop(); - }); - } - ] - }; - }, - async check(diagnostics) { - expect(diagnostics).toMatchInlineSnapshot(` - Object { - "errors": Array [], - "warnings": Array [], - } - `); - } + description: "Testing proxy methods on warnings: test pop", + options() { + return { + entry: "./require.main.require", + plugins: [ + compiler => { + compiler.hooks.afterCompile.tap("test pop", compilation => { + compilation.warnings.pop(); + }); + } + ] + }; + }, + async check(diagnostics) { + expect(diagnostics).toMatchInlineSnapshot(` + Object { + "errors": Array [], + "warnings": Array [], + } + `); + } }; diff --git a/packages/rspack-test-tools/tests/errorCases/warning-test-push.js b/packages/rspack-test-tools/tests/errorCases/warning-test-push.js index 293b8325667..d46ac7fea70 100644 --- a/packages/rspack-test-tools/tests/errorCases/warning-test-push.js +++ b/packages/rspack-test-tools/tests/errorCases/warning-test-push.js @@ -19,14 +19,14 @@ module.exports = { "errors": Array [], "warnings": Array [ Object { - "message": " ⚠ Error: test push\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " ⚠ Error: test push/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test push\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/warning-test-push.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test push/n at Object.fn (/tests/errorCases/warning-test-push.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, Object { - "message": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Unsupported feature: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n", + "message": " ⚠ Module parse warning:/n ╰─▶ ⚠ Unsupported feature: require.main.require() is not supported by Rspack./n ╭────/n 1 │ require.main.require('./file');/n · ──────────────────────────────/n ╰────/n /n", "moduleId": "./require.main.require.js", - "moduleIdentifier": "packages/rspack-test-tools/tests/fixtures/errors/require.main.require.js", + "moduleIdentifier": "/tests/fixtures/errors/require.main.require.js", "moduleName": "./require.main.require.js", "moduleTrace": Array [], "stack": undefined, diff --git a/packages/rspack-test-tools/tests/errorCases/warning-test-shift.js b/packages/rspack-test-tools/tests/errorCases/warning-test-shift.js index 9fc8fdf10f5..7437412a395 100644 --- a/packages/rspack-test-tools/tests/errorCases/warning-test-shift.js +++ b/packages/rspack-test-tools/tests/errorCases/warning-test-shift.js @@ -23,9 +23,9 @@ module.exports = { "errors": Array [], "warnings": Array [ Object { - "message": " ⚠ Error: test unshift\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " ⚠ Error: test unshift/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test unshift\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/warning-test-shift.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test unshift/n at Object.fn (/tests/errorCases/warning-test-shift.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, ], } diff --git a/packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js b/packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js index 3e6d802bf04..62bcf63d559 100644 --- a/packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js +++ b/packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js @@ -19,9 +19,9 @@ module.exports = { "errors": Array [], "warnings": Array [ Object { - "message": " ⚠ Error: test splice\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " ⚠ Error: test splice/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test splice\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test splice/n at Object.fn (/tests/errorCases/warning-test-splice-1.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, ], } diff --git a/packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js b/packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js index 9ec81289c4e..866aa246908 100644 --- a/packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js +++ b/packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js @@ -19,14 +19,14 @@ module.exports = { "errors": Array [], "warnings": Array [ Object { - "message": " ⚠ Error: test splice\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n │ at xxx\\n", + "message": " ⚠ Error: test splice/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n │ at xxx/n", "moduleTrace": Array [], - "stack": "Error: test splice\\n at Object.fn (packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js::)\\n at next (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsyncStageRange (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at AsyncSeriesHook.callAsync (node_modules/.pnpm/@rspack+lite-tapable@1.0.1/node_modules/@rspack/lite-tapable/dist/index.js::)\\n at packages/rspack/dist/index.js::\\n at packages/rspack/dist/index.js::", + "stack": "Error: test splice/n at Object.fn (/tests/errorCases/warning-test-splice-2.js)/n at next (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsyncStageRange (/node_modules//@rspack/lite-tapable/dist/index.js)/n at AsyncSeriesHook.callAsync (/node_modules//@rspack/lite-tapable/dist/index.js)/n at /packages/rspack/dist/index.js/n at /packages/rspack/dist/index.js", }, Object { - "message": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Unsupported feature: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n", + "message": " ⚠ Module parse warning:/n ╰─▶ ⚠ Unsupported feature: require.main.require() is not supported by Rspack./n ╭────/n 1 │ require.main.require('./file');/n · ──────────────────────────────/n ╰────/n /n", "moduleId": "./require.main.require.js", - "moduleIdentifier": "packages/rspack-test-tools/tests/fixtures/errors/require.main.require.js", + "moduleIdentifier": "/tests/fixtures/errors/require.main.require.js", "moduleName": "./require.main.require.js", "moduleTrace": Array [], "stack": undefined, diff --git a/packages/rspack-test-tools/tests/statsAPICases/asset-info.js b/packages/rspack-test-tools/tests/statsAPICases/asset-info.js index 9a518666d12..3914ed99603 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/asset-info.js +++ b/packages/rspack-test-tools/tests/statsAPICases/asset-info.js @@ -32,67 +32,67 @@ module.exports = { expect(stats?.toJson(statsOptions).assets).toMatchInlineSnapshot(` Array [ Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [ - "main", + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [ + main, ], - "auxiliaryChunks": Array [ - "909", + auxiliaryChunks: Array [ + 909, ], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [], - "chunks": Array [], - "emitted": true, - "filteredRelated": 0, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [ - "89a353e9c515885abd8e", + cached: false, + chunkIdHints: Array [], + chunkNames: Array [], + chunks: Array [], + emitted: true, + filteredRelated: 0, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [ + 89a353e9c515885abd8e, ], - "immutable": true, - "isOverSizeLimit": false, - "related": Object {}, - "sourceFilename": "fixtures/asset/image.png", + immutable: true, + isOverSizeLimit: false, + related: Object {}, + sourceFilename: fixtures/asset/image.png, }, - "isOverSizeLimit": false, - "name": "89a353e9c515885abd8e.png", - "related": Array [], - "size": 14910, - "type": "asset", + isOverSizeLimit: false, + name: 89a353e9c515885abd8e.png, + related: Array [], + size: 14910, + type: asset, }, Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "auxiliaryChunks": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [ - "main", + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + auxiliaryChunks: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [ + main, ], - "chunks": Array [ - "909", + chunks: Array [ + 909, ], - "emitted": true, - "filteredRelated": 0, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [], - "isOverSizeLimit": false, - "javascriptModule": false, - "related": Object { - "sourceMap": Array [ - "main.js.map", + emitted: true, + filteredRelated: 0, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [], + isOverSizeLimit: false, + javascriptModule: false, + related: Object { + sourceMap: Array [ + main.js.map, ], }, }, - "isOverSizeLimit": false, - "name": "main.js", - "related": Array [], - "size": 2763, - "type": "asset", + isOverSizeLimit: false, + name: main.js, + related: Array [], + size: 2763, + type: asset, }, ] `); diff --git a/packages/rspack-test-tools/tests/statsAPICases/basic.js b/packages/rspack-test-tools/tests/statsAPICases/basic.js index d3366e4f938..b35bad5ff30 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/basic.js +++ b/packages/rspack-test-tools/tests/statsAPICases/basic.js @@ -19,7 +19,7 @@ module.exports = { expect(typeof stats?.hash).toBe("string"); expect(stats?.toJson(statsOptions)).toMatchSnapshot(); expect(stats?.toString(statsOptions)).toMatchInlineSnapshot(` - "PublicPath: auto + PublicPath: auto asset main.js 207 bytes {909} [emitted] (name: main) Entrypoint main 207 bytes = main.js chunk {909} (runtime: main) main.js (main) 55 bytes [entry] [rendered] @@ -27,19 +27,19 @@ module.exports = { ./fixtures/a.js [585] 55 bytes {909} [depth 0] [built] [code generated] [no exports] [used exports unknown] - Statement with side_effects in source code at ./fixtures/a.js:1:0-3:2 + Statement with side_effects in source code at ./fixtures/a.js ModuleConcatenation bailout: Module is not an ECMAScript module entry ./fixtures/a cjs self exports reference self [585] ./fixtures/a.js ./fixtures/a.js [585] 55 bytes {909} [depth 0] [built] [code generated] [no exports] [used exports unknown] - Statement with side_effects in source code at ./fixtures/a.js:1:0-3:2 + Statement with side_effects in source code at ./fixtures/a.js ModuleConcatenation bailout: Module is not an ECMAScript module entry ./fixtures/a cjs self exports reference self [585] ./fixtures/a.js - Rspack compiled successfully (d27b1f8bbdf2e13f1b91)" + Rspack compiled successfully (d27b1f8bbdf2e13f1b91) `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/build-time-executed-runtime.js b/packages/rspack-test-tools/tests/statsAPICases/build-time-executed-runtime.js index cc160494b56..32e4e8ee23a 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/build-time-executed-runtime.js +++ b/packages/rspack-test-tools/tests/statsAPICases/build-time-executed-runtime.js @@ -41,164 +41,164 @@ module.exports = { ).toMatchInlineSnapshot(` Array [ Object { - "assets": Array [], - "buildTimeExecuted": true, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": true, - "dependent": undefined, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/compat_get_default_export", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/compat_get_default_export", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 309, - "sizes": Object { - "runtime": 309, + assets: Array [], + buildTimeExecuted: true, + built: false, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: true, + dependent: undefined, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/compat_get_default_export, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/compat_get_default_export, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 309, + sizes: Object { + runtime: 309, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": true, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": true, - "dependent": undefined, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/define_property_getters", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/define_property_getters", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 290, - "sizes": Object { - "runtime": 290, + assets: Array [], + buildTimeExecuted: true, + built: false, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: true, + dependent: undefined, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/define_property_getters, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/define_property_getters, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 290, + sizes: Object { + runtime: 290, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": true, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": true, - "dependent": undefined, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/has_own_property", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/has_own_property", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 107, - "sizes": Object { - "runtime": 107, + assets: Array [], + buildTimeExecuted: true, + built: false, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: true, + dependent: undefined, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/has_own_property, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/has_own_property, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 107, + sizes: Object { + runtime: 107, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": true, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": true, - "dependent": undefined, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/make_namespace_object", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/make_namespace_object", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 280, - "sizes": Object { - "runtime": 280, + assets: Array [], + buildTimeExecuted: true, + built: false, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: true, + dependent: undefined, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/make_namespace_object, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/make_namespace_object, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 280, + sizes: Object { + runtime: 280, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, ] `); diff --git a/packages/rspack-test-tools/tests/statsAPICases/build-time-executed.js b/packages/rspack-test-tools/tests/statsAPICases/build-time-executed.js index 0edabfc280a..c519886544c 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/build-time-executed.js +++ b/packages/rspack-test-tools/tests/statsAPICases/build-time-executed.js @@ -47,161 +47,161 @@ module.exports = { .toMatchInlineSnapshot(` Array [ Object { - "buildTimeExecuted": true, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": true, - "errors": 0, - "failed": false, - "identifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "moduleType": "javascript/auto", - "name": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "nameForCondition": "/packages/rspack-test-tools/tests/fixtures/css/style.css", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css:4:0-100", + buildTimeExecuted: true, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: true, + errors: 0, + failed: false, + identifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + moduleType: javascript/auto, + name: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + nameForCondition: /packages/rspack-test-tools/tests/fixtures/css/style.css, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css-100, ], - "optional": false, - "orphan": true, - "providedExports": null, - "reasons": Array [ + optional: false, + orphan: true, + providedExports: null, + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "loader import", - "userRequest": "/packages/rspack-test-tools/tests/fixtures/css/style.css.webpack[javascript/auto]!=!!!/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", + moduleId: null, + resolvedModuleId: null, + type: loader import, + userRequest: /packages/rspack-test-tools/tests/fixtures/css/style.css.webpack[javascript/auto]!=!!!/node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, }, ], - "size": 758, - "sizes": Object { - "javascript": 758, + size: 758, + sizes: Object { + javascript: 758, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "buildTimeExecuted": true, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": true, - "errors": 0, - "failed": false, - "identifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", - "issuer": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "issuerName": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "issuerPath": Array [ + buildTimeExecuted: true, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: true, + errors: 0, + failed: false, + identifier: /node_modules//css-loader/dist/runtime/api.js, + issuer: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + issuerName: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + issuerPath: Array [ Object { - "identifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "name": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", + identifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + name: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, }, ], - "moduleType": "javascript/auto", - "name": "../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", - "nameForCondition": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js:7:0-85:2", + moduleType: javascript/auto, + name: ../../../node_modules//css-loader/dist/runtime/api.js, + nameForCondition: /node_modules//css-loader/dist/runtime/api.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ../../../node_modules//css-loader/dist/runtime/api.js, ], - "optional": false, - "orphan": true, - "providedExports": null, - "reasons": Array [ + optional: false, + orphan: true, + providedExports: null, + reasons: Array [ Object { - "moduleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "moduleName": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModule": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModuleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "type": "esm import", - "userRequest": "../../../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", + moduleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + moduleName: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModule: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModuleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + type: esm import, + userRequest: ../../../../../node_modules//css-loader/dist/runtime/api.js, }, Object { - "moduleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "moduleName": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModule": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModuleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "type": "esm import specifier", - "userRequest": "../../../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", + moduleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + moduleName: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModule: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModuleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + type: esm import specifier, + userRequest: ../../../../../node_modules//css-loader/dist/runtime/api.js, }, Object { - "moduleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", - "moduleName": "../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", - "resolvedModule": "../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", - "resolvedModuleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/api.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleIdentifier: /node_modules//css-loader/dist/runtime/api.js, + moduleName: ../../../node_modules//css-loader/dist/runtime/api.js, + resolvedModule: ../../../node_modules//css-loader/dist/runtime/api.js, + resolvedModuleIdentifier: /node_modules//css-loader/dist/runtime/api.js, + type: cjs self exports reference, + userRequest: self, }, ], - "size": 2303, - "sizes": Object { - "javascript": 2303, + size: 2303, + sizes: Object { + javascript: 2303, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "buildTimeExecuted": true, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": true, - "errors": 0, - "failed": false, - "identifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", - "issuer": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "issuerName": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "issuerPath": Array [ + buildTimeExecuted: true, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: true, + errors: 0, + failed: false, + identifier: /node_modules//css-loader/dist/runtime/noSourceMaps.js, + issuer: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + issuerName: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + issuerPath: Array [ Object { - "identifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "name": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", + identifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + name: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, }, ], - "moduleType": "javascript/auto", - "name": "../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", - "nameForCondition": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js:3:0-5:2", + moduleType: javascript/auto, + name: ../../../node_modules//css-loader/dist/runtime/noSourceMaps.js, + nameForCondition: /node_modules//css-loader/dist/runtime/noSourceMaps.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ../../../node_modules//css-loader/dist/runtime/noSourceMaps.js, ], - "optional": false, - "orphan": true, - "providedExports": null, - "reasons": Array [ + optional: false, + orphan: true, + providedExports: null, + reasons: Array [ Object { - "moduleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "moduleName": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModule": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModuleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "type": "esm import", - "userRequest": "../../../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", + moduleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + moduleName: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModule: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModuleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + type: esm import, + userRequest: ../../../../../node_modules//css-loader/dist/runtime/noSourceMaps.js, }, Object { - "moduleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "moduleName": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModule": "./fixtures/css/style.css!=!../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!./fixtures/css/style.css", - "resolvedModuleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css", - "type": "esm import specifier", - "userRequest": "../../../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", + moduleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + moduleName: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModule: ./fixtures/css/style.css!=!../../../node_modules//css-loader/dist/cjs.js!./fixtures/css/style.css, + resolvedModuleIdentifier: /node_modules//css-loader/dist/cjs.js!/packages/rspack-test-tools/tests/fixtures/css/style.css, + type: esm import specifier, + userRequest: ../../../../../node_modules//css-loader/dist/runtime/noSourceMaps.js, }, Object { - "moduleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", - "moduleName": "../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", - "resolvedModule": "../../../node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", - "resolvedModuleIdentifier": "/node_modules/.pnpm/css-loader@6.11.0_@rspack+core@packages+rspack_webpack@5.94.0_@swc+core@1.4.0_@swc+helpers@0._jlcdgjlw2ezzhg43ml3d627wdu/node_modules/css-loader/dist/runtime/noSourceMaps.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleIdentifier: /node_modules//css-loader/dist/runtime/noSourceMaps.js, + moduleName: ../../../node_modules//css-loader/dist/runtime/noSourceMaps.js, + resolvedModule: ../../../node_modules//css-loader/dist/runtime/noSourceMaps.js, + resolvedModuleIdentifier: /node_modules//css-loader/dist/runtime/noSourceMaps.js, + type: cjs self exports reference, + userRequest: self, }, ], - "size": 64, - "sizes": Object { - "javascript": 64, + size: 64, + sizes: Object { + javascript: 64, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, ] `); diff --git a/packages/rspack-test-tools/tests/statsAPICases/bundler-info.js b/packages/rspack-test-tools/tests/statsAPICases/bundler-info.js index 10ac6d3fd87..ceb6bb1171f 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/bundler-info.js +++ b/packages/rspack-test-tools/tests/statsAPICases/bundler-info.js @@ -25,88 +25,88 @@ module.exports = { ).toMatchInlineSnapshot(` Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: false, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": false, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/rspack_unique_id", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/rspack_unique_id", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": false, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 52, - "sizes": Object { - "runtime": 52, + codeGenerated: true, + dependent: false, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/rspack_unique_id, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/rspack_unique_id, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: false, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 52, + sizes: Object { + runtime: 52, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": false, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: false, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": false, - "depth": undefined, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "", - "identifier": "webpack/runtime/rspack_version", - "index": undefined, - "index2": undefined, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "runtime", - "name": "webpack/runtime/rspack_version", - "nameForCondition": undefined, - "optimizationBailout": Array [], - "optional": false, - "orphan": false, - "postOrderIndex": undefined, - "preOrderIndex": undefined, - "providedExports": Array [], - "reasons": Array [], - "size": 60, - "sizes": Object { - "runtime": 60, + codeGenerated: true, + dependent: false, + depth: undefined, + errors: 0, + failed: false, + filteredReasons: undefined, + id: , + identifier: webpack/runtime/rspack_version, + index: undefined, + index2: undefined, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: runtime, + name: webpack/runtime/rspack_version, + nameForCondition: undefined, + optimizationBailout: Array [], + optional: false, + orphan: false, + postOrderIndex: undefined, + preOrderIndex: undefined, + providedExports: Array [], + reasons: Array [], + size: 60, + sizes: Object { + runtime: 60, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, ] `); diff --git a/packages/rspack-test-tools/tests/statsAPICases/child-compiler.js b/packages/rspack-test-tools/tests/statsAPICases/child-compiler.js index 8be6292326c..bfbeb078b2b 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/child-compiler.js +++ b/packages/rspack-test-tools/tests/statsAPICases/child-compiler.js @@ -47,94 +47,94 @@ module.exports = { async check(stats) { expect(statsJson).toMatchInlineSnapshot(` Object { - "assets": Array [ + assets: Array [ Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [], - "emitted": true, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "development": false, - "fullhash": Array [], - "hotModuleReplacement": false, - "immutable": false, - "isOverSizeLimit": false, - "javascriptModule": false, - "minimized": true, - "related": Object {}, + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [], + emitted: true, + info: Object { + chunkhash: Array [], + contenthash: Array [], + development: false, + fullhash: Array [], + hotModuleReplacement: false, + immutable: false, + isOverSizeLimit: false, + javascriptModule: false, + minimized: true, + related: Object {}, }, - "name": "TestChild.js", - "size": 353, - "type": "asset", + name: TestChild.js, + size: 353, + type: asset, }, Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [ - "main", + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [ + main, ], - "emitted": true, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [], - "isOverSizeLimit": false, - "javascriptModule": false, - "minimized": true, - "related": Object {}, + emitted: true, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [], + isOverSizeLimit: false, + javascriptModule: false, + minimized: true, + related: Object {}, }, - "name": "main.js", - "size": 207, - "type": "asset", + name: main.js, + size: 207, + type: asset, }, ], - "assetsByChunkName": Object { - "main": Array [ - "main.js", + assetsByChunkName: Object { + main: Array [ + main.js, ], }, - "children": Array [ + children: Array [ Object { - "assets": Array [ + assets: Array [ Object { - "auxiliaryChunkIdHints": Array [], - "auxiliaryChunkNames": Array [], - "cached": false, - "chunkIdHints": Array [], - "chunkNames": Array [ - "TestChild", + auxiliaryChunkIdHints: Array [], + auxiliaryChunkNames: Array [], + cached: false, + chunkIdHints: Array [], + chunkNames: Array [ + TestChild, ], - "emitted": true, - "info": Object { - "chunkhash": Array [], - "contenthash": Array [], - "fullhash": Array [], - "javascriptModule": false, - "minimized": true, - "related": Object {}, + emitted: true, + info: Object { + chunkhash: Array [], + contenthash: Array [], + fullhash: Array [], + javascriptModule: false, + minimized: true, + related: Object {}, }, - "name": "TestChild.js", - "size": 353, - "type": "asset", + name: TestChild.js, + size: 353, + type: asset, }, ], - "assetsByChunkName": Object { - "TestChild": Array [ - "TestChild.js", + assetsByChunkName: Object { + TestChild: Array [ + TestChild.js, ], }, - "children": Array [], - "filteredAssets": undefined, - "name": "TestChild", + children: Array [], + filteredAssets: undefined, + name: TestChild, }, ], - "filteredAssets": undefined, + filteredAssets: undefined, } `); } diff --git a/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js b/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js index e481a5db17f..ba651247183 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js +++ b/packages/rspack-test-tools/tests/statsAPICases/chunk-group.js @@ -22,241 +22,241 @@ module.exports = { }; expect(stats?.toJson(statsOptions).entrypoints).toMatchInlineSnapshot(` Object { - "main": Object { - "assets": Array [ + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 14505, + name: main.js, + size: 14505, }, ], - "assetsSize": 14505, - "auxiliaryAssets": Array [ + assetsSize: 14505, + auxiliaryAssets: Array [ Object { - "name": "main.js.map", - "size": 684, + name: main.js.map, + size: 684, }, ], - "auxiliaryAssetsSize": 684, - "childAssets": Object {}, - "children": Object { - "prefetch": Array [ + auxiliaryAssetsSize: 684, + childAssets: Object {}, + children: Object { + prefetch: Array [ Object { - "assets": Array [ + assets: Array [ Object { - "name": "chunk.js", - "size": 862, + name: chunk.js, + size: 862, }, ], - "assetsSize": 862, - "auxiliaryAssets": Array [ + assetsSize: 862, + auxiliaryAssets: Array [ Object { - "name": "chunk.js.map", - "size": 514, + name: chunk.js.map, + size: 514, }, ], - "auxiliaryAssetsSize": 514, - "chunks": Array [ - "919", + auxiliaryAssetsSize: 514, + chunks: Array [ + 919, ], - "name": "chunk", + name: chunk, }, ], }, - "chunks": Array [ - "909", + chunks: Array [ + 909, ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, } `); expect(stats?.toJson(statsOptions).namedChunkGroups).toMatchInlineSnapshot(` Object { - "chunk": Object { - "assets": Array [ + chunk: Object { + assets: Array [ Object { - "name": "chunk.js", - "size": 862, + name: chunk.js, + size: 862, }, ], - "assetsSize": 862, - "auxiliaryAssets": Array [ + assetsSize: 862, + auxiliaryAssets: Array [ Object { - "name": "chunk.js.map", - "size": 514, + name: chunk.js.map, + size: 514, }, ], - "auxiliaryAssetsSize": 514, - "childAssets": Object { - "prefetch": Array [ - "chunk-b.js", + auxiliaryAssetsSize: 514, + childAssets: Object { + prefetch: Array [ + chunk-b.js, ], - "preload": Array [ - "chunk-b.js", + preload: Array [ + chunk-b.js, ], }, - "children": Object { - "prefetch": Array [ + children: Object { + prefetch: Array [ Object { - "assets": Array [ + assets: Array [ Object { - "name": "chunk-c.js", - "size": 136, + name: chunk-c.js, + size: 136, }, ], - "assetsSize": 136, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "chunks": Array [ - "212", + assetsSize: 136, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + chunks: Array [ + 212, ], - "name": "chunk-c", + name: chunk-c, }, Object { - "assets": Array [ + assets: Array [ Object { - "name": "chunk-a.js", - "size": 136, + name: chunk-a.js, + size: 136, }, ], - "assetsSize": 136, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "chunks": Array [ - "807", + assetsSize: 136, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + chunks: Array [ + 807, ], - "name": "chunk-a", + name: chunk-a, }, ], - "preload": Array [ + preload: Array [ Object { - "assets": Array [ + assets: Array [ Object { - "name": "chunk-b.js", - "size": 136, + name: chunk-b.js, + size: 136, }, ], - "assetsSize": 136, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "chunks": Array [ - "805", + assetsSize: 136, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + chunks: Array [ + 805, ], - "name": "chunk-b", + name: chunk-b, }, ], }, - "chunks": Array [ - "919", + chunks: Array [ + 919, ], - "filteredAssets": 0, - "isOverSizeLimit": undefined, - "name": "chunk", + filteredAssets: 0, + isOverSizeLimit: undefined, + name: chunk, }, - "chunk-a": Object { - "assets": Array [ + chunk-a: Object { + assets: Array [ Object { - "name": "chunk-a.js", - "size": 136, + name: chunk-a.js, + size: 136, }, ], - "assetsSize": 136, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "807", + assetsSize: 136, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 807, ], - "filteredAssets": 0, - "isOverSizeLimit": undefined, - "name": "chunk-a", + filteredAssets: 0, + isOverSizeLimit: undefined, + name: chunk-a, }, - "chunk-b": Object { - "assets": Array [ + chunk-b: Object { + assets: Array [ Object { - "name": "chunk-b.js", - "size": 136, + name: chunk-b.js, + size: 136, }, ], - "assetsSize": 136, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "805", + assetsSize: 136, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 805, ], - "filteredAssets": 0, - "isOverSizeLimit": undefined, - "name": "chunk-b", + filteredAssets: 0, + isOverSizeLimit: undefined, + name: chunk-b, }, - "chunk-c": Object { - "assets": Array [ + chunk-c: Object { + assets: Array [ Object { - "name": "chunk-c.js", - "size": 136, + name: chunk-c.js, + size: 136, }, ], - "assetsSize": 136, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [ - "212", + assetsSize: 136, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [ + 212, ], - "filteredAssets": 0, - "isOverSizeLimit": undefined, - "name": "chunk-c", + filteredAssets: 0, + isOverSizeLimit: undefined, + name: chunk-c, }, - "main": Object { - "assets": Array [ + main: Object { + assets: Array [ Object { - "name": "main.js", - "size": 14505, + name: main.js, + size: 14505, }, ], - "assetsSize": 14505, - "auxiliaryAssets": Array [ + assetsSize: 14505, + auxiliaryAssets: Array [ Object { - "name": "main.js.map", - "size": 684, + name: main.js.map, + size: 684, }, ], - "auxiliaryAssetsSize": 684, - "childAssets": Object {}, - "children": Object { - "prefetch": Array [ + auxiliaryAssetsSize: 684, + childAssets: Object {}, + children: Object { + prefetch: Array [ Object { - "assets": Array [ + assets: Array [ Object { - "name": "chunk.js", - "size": 862, + name: chunk.js, + size: 862, }, ], - "assetsSize": 862, - "auxiliaryAssets": Array [ + assetsSize: 862, + auxiliaryAssets: Array [ Object { - "name": "chunk.js.map", - "size": 514, + name: chunk.js.map, + size: 514, }, ], - "auxiliaryAssetsSize": 514, - "chunks": Array [ - "919", + auxiliaryAssetsSize: 514, + chunks: Array [ + 919, ], - "name": "chunk", + name: chunk, }, ], }, - "chunks": Array [ - "909", + chunks: Array [ + 909, ], - "filteredAssets": 0, - "isOverSizeLimit": false, - "name": "main", + filteredAssets: 0, + isOverSizeLimit: false, + name: main, }, } `); diff --git a/packages/rspack-test-tools/tests/statsAPICases/chunks.js b/packages/rspack-test-tools/tests/statsAPICases/chunks.js index 0a6d5d1a139..7b238cb8ea6 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/chunks.js +++ b/packages/rspack-test-tools/tests/statsAPICases/chunks.js @@ -19,225 +19,225 @@ module.exports = { ).toMatchInlineSnapshot(` Array [ Object { - "auxiliaryFiles": Array [], - "children": Array [], - "childrenByOrder": Object {}, - "entry": false, - "files": Array [ - "chunkB.js", + auxiliaryFiles: Array [], + children: Array [], + childrenByOrder: Object {}, + entry: false, + files: Array [ + chunkB.js, ], - "filteredModules": undefined, - "hash": "bf7629c34eadb1d16318", - "id": "250", - "idHints": Array [], - "initial": false, - "modules": Array [ + filteredModules: undefined, + hash: bf7629c34eadb1d16318, + id: 250, + idHints: Array [], + initial: false, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "250", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 250, ], - "codeGenerated": true, - "dependent": false, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "101", - "identifier": "/tests/fixtures/b.js", - "index": 1, - "index2": 1, - "issuer": "/tests/fixtures/chunk-b.js", - "issuerId": "725", - "issuerName": "./fixtures/chunk-b.js", - "issuerPath": Array [ + codeGenerated: true, + dependent: false, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 101, + identifier: /tests/fixtures/b.js, + index: 1, + index2: 1, + issuer: /tests/fixtures/chunk-b.js, + issuerId: 725, + issuerName: ./fixtures/chunk-b.js, + issuerPath: Array [ Object { - "id": "725", - "identifier": "/tests/fixtures/chunk-b.js", - "name": "./fixtures/chunk-b.js", + id: 725, + identifier: /tests/fixtures/chunk-b.js, + name: ./fixtures/chunk-b.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/b.js", - "nameForCondition": "/tests/fixtures/b.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/b.js:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/b.js, + nameForCondition: /tests/fixtures/b.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/b.js, + ModuleConcatenation bailout: Module is not an ECMAScript module, ], - "optional": false, - "orphan": false, - "postOrderIndex": 1, - "preOrderIndex": 1, - "providedExports": Array [], - "reasons": Array [ + optional: false, + orphan: false, + postOrderIndex: 1, + preOrderIndex: 1, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": "101", - "moduleIdentifier": "/tests/fixtures/b.js", - "moduleName": "./fixtures/b.js", - "resolvedModule": "./fixtures/b.js", - "resolvedModuleId": "101", - "resolvedModuleIdentifier": "/tests/fixtures/b.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 101, + moduleIdentifier: /tests/fixtures/b.js, + moduleName: ./fixtures/b.js, + resolvedModule: ./fixtures/b.js, + resolvedModuleId: 101, + resolvedModuleIdentifier: /tests/fixtures/b.js, + type: cjs self exports reference, + userRequest: self, }, Object { - "moduleId": "725", - "moduleIdentifier": "/tests/fixtures/chunk-b.js", - "moduleName": "./fixtures/chunk-b.js", - "resolvedModule": "./fixtures/chunk-b.js", - "resolvedModuleId": "725", - "resolvedModuleIdentifier": "/tests/fixtures/chunk-b.js", - "type": "import()", - "userRequest": "./b", + moduleId: 725, + moduleIdentifier: /tests/fixtures/chunk-b.js, + moduleName: ./fixtures/chunk-b.js, + resolvedModule: ./fixtures/chunk-b.js, + resolvedModuleId: 725, + resolvedModuleIdentifier: /tests/fixtures/chunk-b.js, + type: import(), + userRequest: ./b, }, ], - "size": 94, - "sizes": Object { - "javascript": 94, + size: 94, + sizes: Object { + javascript: 94, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, ], - "names": Array [ - "chunkB", + names: Array [ + chunkB, ], - "origins": Array [ + origins: Array [ Object { - "loc": "2:9-55", - "module": "/tests/fixtures/chunk-b.js", - "moduleId": "725", - "moduleIdentifier": "/tests/fixtures/chunk-b.js", - "moduleName": "./fixtures/chunk-b.js", - "request": "./b", + loc: 2:9-55, + module: /tests/fixtures/chunk-b.js, + moduleId: 725, + moduleIdentifier: /tests/fixtures/chunk-b.js, + moduleName: ./fixtures/chunk-b.js, + request: ./b, }, ], - "parents": Array [ - "909", + parents: Array [ + 909, ], - "reason": undefined, - "rendered": true, - "runtime": Array [ - "main", + reason: undefined, + rendered: true, + runtime: Array [ + main, ], - "siblings": Array [], - "size": 94, - "sizes": Object { - "javascript": 94, + siblings: Array [], + size: 94, + sizes: Object { + javascript: 94, }, - "type": "chunk", + type: chunk, }, Object { - "auxiliaryFiles": Array [], - "children": Array [ - "250", + auxiliaryFiles: Array [], + children: Array [ + 250, ], - "childrenByOrder": Object {}, - "entry": true, - "files": Array [ - "main.js", + childrenByOrder: Object {}, + entry: true, + files: Array [ + main.js, ], - "filteredModules": undefined, - "hash": "c0a99515ebfa264f9f23", - "id": "909", - "idHints": Array [], - "initial": true, - "modules": Array [ + filteredModules: undefined, + hash: c0a99515ebfa264f9f23, + id: 909, + idHints: Array [], + initial: true, + modules: Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [ - "909", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [ + 909, ], - "codeGenerated": true, - "dependent": false, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": "725", - "identifier": "/tests/fixtures/chunk-b.js", - "index": 0, - "index2": 0, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/chunk-b.js", - "nameForCondition": "/tests/fixtures/chunk-b.js", - "optimizationBailout": Array [ - "Statement with side_effects in source code at ./fixtures/chunk-b.js:1:0-3:2", - "ModuleConcatenation bailout: Module is not an ECMAScript module", + codeGenerated: true, + dependent: false, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: 725, + identifier: /tests/fixtures/chunk-b.js, + index: 0, + index2: 0, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/chunk-b.js, + nameForCondition: /tests/fixtures/chunk-b.js, + optimizationBailout: Array [ + Statement with side_effects in source code at ./fixtures/chunk-b.js, + ModuleConcatenation bailout: Module is not an ECMAScript module, ], - "optional": false, - "orphan": false, - "postOrderIndex": 0, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [ + optional: false, + orphan: false, + postOrderIndex: 0, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [ Object { - "moduleId": null, - "resolvedModuleId": null, - "type": "entry", - "userRequest": "./fixtures/chunk-b", + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/chunk-b, }, Object { - "moduleId": "725", - "moduleIdentifier": "/tests/fixtures/chunk-b.js", - "moduleName": "./fixtures/chunk-b.js", - "resolvedModule": "./fixtures/chunk-b.js", - "resolvedModuleId": "725", - "resolvedModuleIdentifier": "/tests/fixtures/chunk-b.js", - "type": "cjs self exports reference", - "userRequest": "self", + moduleId: 725, + moduleIdentifier: /tests/fixtures/chunk-b.js, + moduleName: ./fixtures/chunk-b.js, + resolvedModule: ./fixtures/chunk-b.js, + resolvedModuleId: 725, + resolvedModuleIdentifier: /tests/fixtures/chunk-b.js, + type: cjs self exports reference, + userRequest: self, }, ], - "size": 85, - "sizes": Object { - "javascript": 85, + size: 85, + sizes: Object { + javascript: 85, }, - "type": "module", - "usedExports": null, - "warnings": 0, + type: module, + usedExports: null, + warnings: 0, }, ], - "names": Array [ - "main", + names: Array [ + main, ], - "origins": Array [ + origins: Array [ Object { - "loc": "main", - "module": "", - "moduleId": undefined, - "moduleIdentifier": "", - "moduleName": "", - "request": "./fixtures/chunk-b", + loc: main, + module: , + moduleId: undefined, + moduleIdentifier: , + moduleName: , + request: ./fixtures/chunk-b, }, ], - "parents": Array [], - "reason": undefined, - "rendered": true, - "runtime": Array [ - "main", + parents: Array [], + reason: undefined, + rendered: true, + runtime: Array [ + main, ], - "siblings": Array [], - "size": 85, - "sizes": Object { - "javascript": 85, - "runtime": 9129, + siblings: Array [], + size: 85, + sizes: Object { + javascript: 85, + runtime: 9129, }, - "type": "chunk", + type: chunk, }, ] `); diff --git a/packages/rspack-test-tools/tests/statsAPICases/error-chunk.js b/packages/rspack-test-tools/tests/statsAPICases/error-chunk.js index e8042daa033..5a46db1c094 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/error-chunk.js +++ b/packages/rspack-test-tools/tests/statsAPICases/error-chunk.js @@ -24,16 +24,15 @@ module.exports = { ).toMatchInlineSnapshot(` Array [ Object { - "chunkEntry": true, - "chunkId": "751", - "chunkInitial": true, - "chunkName": "b", - "details": undefined, - "message": " × Entrypoints 'b' and 'a' use 'dependOn' to depend on each other in a circular way. - ", - "moduleTrace": Array [], - "stack": undefined, - }, + "chunkEntry": true, + "chunkId": "751", + "chunkInitial": true, + "chunkName": "b", + "details": undefined, + "message": " × Entrypoints 'b' and 'a' use 'dependOn' to depend on each other in a circular way./n", + "moduleTrace": Array [], + "stack": undefined, + }, ] `); } diff --git a/packages/rspack-test-tools/tests/statsAPICases/exports.js b/packages/rspack-test-tools/tests/statsAPICases/exports.js index d10364185b9..6fec2a418f2 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/exports.js +++ b/packages/rspack-test-tools/tests/statsAPICases/exports.js @@ -24,13 +24,13 @@ module.exports = { expect(typeof stats?.hash).toBe("string"); expect(stats?.toJson(statsOptions)).toMatchSnapshot(); expect(stats?.toString(statsOptions)).toMatchInlineSnapshot(` - "asset main.js 441 bytes [emitted] (name: main) + asset main.js 441 bytes [emitted] (name: main) orphan modules 192 bytes [orphan] 4 modules runtime modules 677 bytes 3 modules ./fixtures/esm/abc.js + 3 modules 192 bytes [code generated] [no exports] [no exports used] - Rspack compiled successfully" + Rspack compiled successfully `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/ids.js b/packages/rspack-test-tools/tests/statsAPICases/ids.js index f3335ffa34c..eb037c0b064 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/ids.js +++ b/packages/rspack-test-tools/tests/statsAPICases/ids.js @@ -17,9 +17,9 @@ module.exports = { }; expect(stats?.toJson(options)).toMatchSnapshot(); expect(stats?.toString(options)).toMatchInlineSnapshot(` - "asset main.js 207 bytes {909} [emitted] (name: main) + asset main.js 207 bytes {909} [emitted] (name: main) chunk {909} (runtime: main) main.js (main) 55 bytes [entry] [rendered] - ./fixtures/a.js [585] 55 bytes {909} [built] [code generated]" + ./fixtures/a.js [585] 55 bytes {909} [built] [code generated] `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/layer.js b/packages/rspack-test-tools/tests/statsAPICases/layer.js index 583878cc51b..86aa2fe7580 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/layer.js +++ b/packages/rspack-test-tools/tests/statsAPICases/layer.js @@ -22,10 +22,10 @@ module.exports = { }; expect(stats?.toJson(options)).toMatchSnapshot(); expect(stats?.toString(options)).toMatchInlineSnapshot(` - "./fixtures/abc.js (in test) 83 bytes [built] [code generated] + ./fixtures/abc.js (in test) 83 bytes [built] [code generated] ./fixtures/a.js (in test) 55 bytes [built] [code generated] ./fixtures/b.js (in test) 94 bytes [built] [code generated] - ./fixtures/c.js (in test) 72 bytes [built] [code generated]" + ./fixtures/c.js (in test) 72 bytes [built] [code generated] `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/nested-modules.js b/packages/rspack-test-tools/tests/statsAPICases/nested-modules.js index 01cd08d2256..65b0b5161f6 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/nested-modules.js +++ b/packages/rspack-test-tools/tests/statsAPICases/nested-modules.js @@ -27,271 +27,271 @@ module.exports = { expect(concatedModule.modules).toMatchInlineSnapshot(` Array [ Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 0, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "index": 0, - "index2": 3, - "issuer": undefined, - "issuerId": undefined, - "issuerName": undefined, - "issuerPath": undefined, - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/abc.js", - "nameForCondition": "/tests/fixtures/esm/abc.js", - "optimizationBailout": Array [ - "ModuleConcatenation bailout: Module is an entry point", + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 0, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + index: 0, + index2: 3, + issuer: undefined, + issuerId: undefined, + issuerName: undefined, + issuerPath: undefined, + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/abc.js, + nameForCondition: /tests/fixtures/esm/abc.js, + optimizationBailout: Array [ + ModuleConcatenation bailout: Module is an entry point, ], - "optional": false, - "orphan": true, - "postOrderIndex": 3, - "preOrderIndex": 0, - "providedExports": Array [], - "reasons": Array [], - "size": 80, - "sizes": Object { - "javascript": 80, + optional: false, + orphan: true, + postOrderIndex: 3, + preOrderIndex: 0, + providedExports: Array [], + reasons: Array [], + size: 80, + sizes: Object { + javascript: 80, }, - "type": "module", - "usedExports": Array [], - "warnings": 0, + type: module, + usedExports: Array [], + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/a.js", - "index": 1, - "index2": 0, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/a.js, + index: 1, + index2: 0, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/a.js", - "nameForCondition": "/tests/fixtures/esm/a.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 0, - "preOrderIndex": 1, - "providedExports": Array [ - "a", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/a.js, + nameForCondition: /tests/fixtures/esm/a.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 0, + preOrderIndex: 1, + providedExports: Array [ + a, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./a, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./a", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./a, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": Array [ - "a", + type: module, + usedExports: Array [ + a, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/b.js", - "index": 2, - "index2": 1, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/b.js, + index: 2, + index2: 1, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/b.js", - "nameForCondition": "/tests/fixtures/esm/b.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 1, - "preOrderIndex": 2, - "providedExports": Array [ - "b", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/b.js, + nameForCondition: /tests/fixtures/esm/b.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 1, + preOrderIndex: 2, + providedExports: Array [ + b, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./b, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./b", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./b, }, ], - "size": 38, - "sizes": Object { - "javascript": 38, + size: 38, + sizes: Object { + javascript: 38, }, - "type": "module", - "usedExports": Array [ - "default", + type: module, + usedExports: Array [ + default, ], - "warnings": 0, + warnings: 0, }, Object { - "assets": Array [], - "buildTimeExecuted": false, - "built": true, - "cacheable": true, - "cached": false, - "chunks": Array [], - "codeGenerated": false, - "dependent": undefined, - "depth": 1, - "errors": 0, - "failed": false, - "filteredReasons": undefined, - "id": undefined, - "identifier": "/tests/fixtures/esm/c.js", - "index": 3, - "index2": 2, - "issuer": "/tests/fixtures/esm/abc.js", - "issuerId": undefined, - "issuerName": "./fixtures/esm/abc.js", - "issuerPath": Array [ + assets: Array [], + buildTimeExecuted: false, + built: true, + cacheable: true, + cached: false, + chunks: Array [], + codeGenerated: false, + dependent: undefined, + depth: 1, + errors: 0, + failed: false, + filteredReasons: undefined, + id: undefined, + identifier: /tests/fixtures/esm/c.js, + index: 3, + index2: 2, + issuer: /tests/fixtures/esm/abc.js, + issuerId: undefined, + issuerName: ./fixtures/esm/abc.js, + issuerPath: Array [ Object { - "id": undefined, - "identifier": "/tests/fixtures/esm/abc.js", - "name": "./fixtures/esm/abc.js", + id: undefined, + identifier: /tests/fixtures/esm/abc.js, + name: ./fixtures/esm/abc.js, }, ], - "layer": undefined, - "moduleType": "javascript/auto", - "name": "./fixtures/esm/c.js", - "nameForCondition": "/tests/fixtures/esm/c.js", - "optimizationBailout": Array [], - "optional": false, - "orphan": true, - "postOrderIndex": 2, - "preOrderIndex": 3, - "providedExports": Array [ - "c", - "default", + layer: undefined, + moduleType: javascript/auto, + name: ./fixtures/esm/c.js, + nameForCondition: /tests/fixtures/esm/c.js, + optimizationBailout: Array [], + optional: false, + orphan: true, + postOrderIndex: 2, + preOrderIndex: 3, + providedExports: Array [ + c, + default, ], - "reasons": Array [ + reasons: Array [ Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import, + userRequest: ./c, }, Object { - "moduleId": undefined, - "moduleIdentifier": "/tests/fixtures/esm/abc.js", - "moduleName": "./fixtures/esm/abc.js", - "resolvedModule": "./fixtures/esm/abc.js", - "resolvedModuleId": undefined, - "resolvedModuleIdentifier": "/tests/fixtures/esm/abc.js", - "type": "esm import specifier", - "userRequest": "./c", + moduleId: undefined, + moduleIdentifier: /tests/fixtures/esm/abc.js, + moduleName: ./fixtures/esm/abc.js, + resolvedModule: ./fixtures/esm/abc.js, + resolvedModuleId: undefined, + resolvedModuleIdentifier: /tests/fixtures/esm/abc.js, + type: esm import specifier, + userRequest: ./c, }, ], - "size": 37, - "sizes": Object { - "javascript": 37, + size: 37, + sizes: Object { + javascript: 37, }, - "type": "module", - "usedExports": true, - "warnings": 0, + type: module, + usedExports: true, + warnings: 0, }, ] `); expect(stats?.toString(statsOptions).replace(/\d+ ms/g, "X ms")) .toMatchInlineSnapshot(` - "asset main.js 441 bytes [emitted] (name: main) + asset main.js 441 bytes [emitted] (name: main) orphan modules 192 bytes [orphan] 4 modules runtime modules 677 bytes 3 modules ./fixtures/esm/abc.js + 3 modules 192 bytes [code generated] | orphan modules 192 bytes [orphan] 4 modules - Rspack compiled successfully" + Rspack compiled successfully `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/placeholders.js b/packages/rspack-test-tools/tests/statsAPICases/placeholders.js index 8747a8e09cc..504db4a01e3 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/placeholders.js +++ b/packages/rspack-test-tools/tests/statsAPICases/placeholders.js @@ -23,17 +23,17 @@ module.exports = { async check() { expect(stats.entrypoints).toMatchInlineSnapshot(` Object { - "main": Object { - "assets": Array [], - "assetsSize": 0, - "auxiliaryAssets": Array [], - "auxiliaryAssetsSize": 0, - "childAssets": Object {}, - "children": Object {}, - "chunks": Array [], - "filteredAssets": 0, - "isOverSizeLimit": undefined, - "name": "main", + main: Object { + assets: Array [], + assetsSize: 0, + auxiliaryAssets: Array [], + auxiliaryAssetsSize: 0, + childAssets: Object {}, + children: Object {}, + chunks: Array [], + filteredAssets: 0, + isOverSizeLimit: undefined, + name: main, }, } `); diff --git a/packages/rspack-test-tools/tests/statsAPICases/profile.js b/packages/rspack-test-tools/tests/statsAPICases/profile.js index 369a83529d9..390fbd797be 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/profile.js +++ b/packages/rspack-test-tools/tests/statsAPICases/profile.js @@ -12,14 +12,14 @@ module.exports = { expect( stats?.toString({ all: false, modules: true }).replace(/\d+ ms/g, "X ms") ).toMatchInlineSnapshot(` - "./fixtures/abc.js 83 bytes [built] [code generated] + ./fixtures/abc.js 83 bytes [built] [code generated] X ms (resolving: X ms, building: X ms) ./fixtures/a.js 55 bytes [built] [code generated] X ms (resolving: X ms, building: X ms) ./fixtures/b.js 94 bytes [built] [code generated] X ms (resolving: X ms, building: X ms) ./fixtures/c.js 72 bytes [built] [code generated] - X ms (resolving: X ms, building: X ms)" + X ms (resolving: X ms, building: X ms) `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/to-string.js b/packages/rspack-test-tools/tests/statsAPICases/to-string.js index a71e89a0024..863ff5a1637 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/to-string.js +++ b/packages/rspack-test-tools/tests/statsAPICases/to-string.js @@ -10,12 +10,12 @@ module.exports = { async check(stats) { expect(stats?.toString({ timings: false, version: false })) .toMatchInlineSnapshot(` - "asset main.js 353 bytes [emitted] (name: main) + asset main.js 353 bytes [emitted] (name: main) ./fixtures/abc.js 83 bytes [built] [code generated] ./fixtures/a.js 55 bytes [built] [code generated] ./fixtures/b.js 94 bytes [built] [code generated] ./fixtures/c.js 72 bytes [built] [code generated] - Rspack compiled successfully" + Rspack compiled successfully `); } }; diff --git a/packages/rspack-test-tools/tests/statsAPICases/verbose-time.js b/packages/rspack-test-tools/tests/statsAPICases/verbose-time.js index c3fda3beac2..441b51b6c86 100644 --- a/packages/rspack-test-tools/tests/statsAPICases/verbose-time.js +++ b/packages/rspack-test-tools/tests/statsAPICases/verbose-time.js @@ -13,7 +13,7 @@ module.exports = { ?.toString({ all: false, logging: "verbose" }) .replace(/\d+ ms/g, "X ms") ).toMatchInlineSnapshot(` - "LOG from rspack.Compilation + LOG from rspack.Compilation finish modules: X ms optimize dependencies: X ms create chunks: X ms @@ -76,7 +76,6 @@ module.exports = { 0 chunk groups connected 0 chunk groups processed for merging (0 module sets) 0 chunk group info updated (0 already connected chunk groups reconnected) - " `); } }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ca281c8709..defc87bffde 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -560,6 +560,9 @@ importers: mkdirp: specifier: 0.5.6 version: 0.5.6 + path-serializer: + specifier: 0.1.2 + version: 0.1.2 pretty-format: specifier: 29.7.0 version: 29.7.0 @@ -8673,6 +8676,9 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-serializer@0.1.2: + resolution: {integrity: sha512-gF11AVLnQlBmF8UH9mw+sZUd9v4TG24EtHy+sC062PlJ+fUkWGjkfSGdwPqK9JOsi8TxtnziE7gRAv4GEAH+sw==} + path-temp@2.1.0: resolution: {integrity: sha512-cMMJTAZlion/RWRRC48UbrDymEIt+/YSD/l8NqjneyDw2rDOBQcP5yRkMB4CYGn47KMhZvbblBP7Z79OsMw72w==} engines: {node: '>=8.15'} @@ -20966,6 +20972,8 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-serializer@0.1.2: {} + path-temp@2.1.0: dependencies: unique-string: 2.0.0