diff --git a/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap b/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap new file mode 100644 index 00000000000..6224515c3ef --- /dev/null +++ b/packages/rspack-test-tools/tests/__snapshots__/Config.test.js.snap @@ -0,0 +1,773 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`config config/builtin-lightningcss-loader/basic-include exported tests should transform css correct 1`] = ` +body { + & ._-ec1c834ac8cc99e-used { + color: #00f; + } +} + +head{--webpack--909:used:_-ec1c834aĊcc99e-ĀĂ/&_368;} +`; + +exports[`config config/builtin-lightningcss-loader/minify exported tests css content minifyed 1`] = ` +.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: -ec1c834ac8cc99e-style, +} +`; + +exports[`config config/builtins/css-modules-composes exported tests css modules composes 1`] = ` +Object { + simple-bar: -bd00b1e0e0954270-simple-bar -e631de715f468814-imported-simple, + simple-foo: -bd00b1e0e0954270-simple-foo -e631de715f468814-imported-simple, +} +`; + +exports[`config config/builtins/css-modules-composes-preprocessers exported tests css modules with css preprocessers 1`] = ` +Object { + class: -bd00b1e0e0954270-class -a700d75440d0c95b-lessClass, + ghi: -bd00b1e0e0954270-ghi, + other: -bd00b1e0e0954270-other -c82bab3b83825a-scssClass, + otherClassName: -bd00b1e0e0954270-otherClassName globalClassName, +} +`; + +exports[`config config/builtins/css-modules-composes-sass exported tests css modules in scss 1`] = ` +Object { + bar: -f71ebaec3a61562-bar -d2e32b33f9cd5760-foo, +} +`; + +exports[`config config/builtins/css-modules-dedupe exported tests css modules dedupe 1`] = ` +Object { + backButton: -f9dde4a2b9fd39e-backButton -c0cdf795e5ee8e4-secondaryButton -ff2973456bd9e-button, + nextButton: -f9dde4a2b9fd39e-nextButton -fe530a949364eca-primaryButton -ff2973456bd9e-button, +} +`; + +exports[`config config/builtins/css-modules-exports-only exported tests css modules exportsOnly 1`] = ` +Object { + simple-bar: -bd00b1e0e0954270-simple-bar -e631de715f468814-imported-simple, + simple-foo: -bd00b1e0e0954270-simple-foo -e631de715f468814-imported-simple, +} +`; + +exports[`config config/builtins/css-modules-local-ident-name-hash exported tests css modules localIdentName with hash 1`] = ` +Object { + #: c36b985d54c6917, + ##: ab513cc8abd7e7d, + #.#.#: b6aa9e623eb8be, + #fake-id: d65fd648c910d0f, + ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.: fe85c4cd33dc7b53, + -a-b-c-: b1d2002fed1364, + -a0-34a___f: bd6992764ef, + .: f8dc72200543c02, + 123: fc54982b169de010, + 1a2b3c: e0d288534c575c7c, + :): ce45aa5fbb24, + :\`(: c3a47328b233, + :hover: c9cb40d597d6145, + :hover:focus:active: adb078f8a010, + <><<<>><>: e57bed6057bf, +

: d4d795aa031981a3, + ?: ca312bbe575926f7, + @: e73735f9a6fa1e2a, + B&W?: c28b11d8276955d9, + [attr=value]: aefb3cf784f22f09, + _: b892aeed406cef6, + _test: f95d7802389a, + className: b88ec9c3ddaa088, + f!o!o: bc20be6f8aa6ba2b, + f'o'o: a1ad39e5bcb2a, + f*o*o: ee490440b4d27dd, + f+o+o: b2f2e8203ab92e0, + f/o/o: e8e6467eba546855, + f/o/o: ac4b388a402f1b, + foo.bar: bf09604a510669, + foo/bar: f06b4ed00041408a, + foo/bar/baz: b62901907350b529, + foo/bar: cf1721b3e29, + foo/bar/baz: db46f3e1d8ecc82b, + f~o~o: e22953bae58b7, + m_x_@: eede355cc6b0366, + someId: f39bfe4a4606a57c, + subClass: dbb85e97d7af8a70, + test: db0a8ac9537cb87c, + {}: c849d7d50310c200, + ©: fc4038317, + “‘’”: b1f8cf023766, + ⌘⌥: cad802, + ☺☃: a5266303d99e4a3, + ♥: b3f2fd830, + 𝄞♪♩♫♬: c573deb3b242a81b, + 💩: f17b76fb4694950, + 😍: d57d2641b441, +} +`; + +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__😍, +} +`; + +exports[`config config/builtins/css-modules-locals-convention-camelCase exported tests css modules localsConvention with camelCase 1`] = ` +Object { + btn--info_is-disabled_1: -bd00b1e0e0954270-btn--info_is-disabled_1, + btn-info_is-disabled: -bd00b1e0e0954270-btn-info_is-disabled, + btnInfoIsDisabled: -bd00b1e0e0954270-btn-info_is-disabled, + btnInfoIsDisabled1: -bd00b1e0e0954270-btn--info_is-disabled_1, + fooBar: -bd00b1e0e0954270-foo_bar, + foo_bar: -bd00b1e0e0954270-foo_bar, + simple: -bd00b1e0e0954270-simple, +} +`; + +exports[`config config/builtins/css-modules-locals-convention-camelCaseOnly exported tests css modules localsConvention with camelCaseOnly 1`] = ` +Object { + btnInfoIsDisabled: -bd00b1e0e0954270-btn-info_is-disabled, + btnInfoIsDisabled1: -bd00b1e0e0954270-btn--info_is-disabled_1, + fooBar: -bd00b1e0e0954270-foo_bar, + simple: -bd00b1e0e0954270-simple, +} +`; + +exports[`config config/builtins/css-modules-locals-convention-dashes exported tests css modules localsConvention with dashes 1`] = ` +Object { + btn--info_is-disabled_1: -bd00b1e0e0954270-btn--info_is-disabled_1, + btn-info-is-disabled: -bd00b1e0e0954270-btn-info_is-disabled, + btn-info-is-disabled-1: -bd00b1e0e0954270-btn--info_is-disabled_1, + btn-info_is-disabled: -bd00b1e0e0954270-btn-info_is-disabled, + foo-bar: -bd00b1e0e0954270-foo_bar, + foo_bar: -bd00b1e0e0954270-foo_bar, + simple: -bd00b1e0e0954270-simple, +} +`; + +exports[`config config/builtins/css-modules-pseudo exported tests css modules pseudo syntax 1`] = ` +Object { + bar: -bd00b1e0e0954270-bar, + bav: -bd00b1e0e0954270-bav, + foo: -bd00b1e0e0954270-foo, + four: -bd00b1e0e0954270-four, + one: -bd00b1e0e0954270-one, + three: -bd00b1e0e0954270-three, + two: -bd00b1e0e0954270-two, +} +`; + +exports[`config config/builtins/css-modules-simple exported tests css modules simple test 1`] = ` +Object { + style: -ec1c834ac8cc99e-style, +} +`; + +exports[`config config/chunk-index/available-modules-order-index exported tests should compile 1`] = ` +.m { + color: red; +} +.n { + color: blue; +} +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"); +.c { + color: pink; +} + + + + +.a { + color: blue; +} + + + +.b { + color: red; +} + +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" */ +/* +- type: css/auto +*/ + + +.local {} + + + + +/* #endregion "./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`] = `ac673538c200453e.png`; + +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`] = `ac673538c200453e.png`; + +exports[`config config/css/rewrite-url-css-variables exported tests should rewrite the css url() in css variables 2`] = `ac673538c200453e.png`; + +exports[`config config/css/rewrite-url-with-css-filename exported tests should rewrite the css url() with publicPath and ~@ prefix 1`] = `/image/logo.ac673538.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.ac673538.png`; + +exports[`config config/css/urls exported tests css urls should works 1`] = ` +/* @supports (background-image: url("unknown.png")) { + div { + a195: url("img.png"); + } +} */ + +div { + a13: green url(data:image/png;base64,AAA) url(http://example.com/image.jpg) url(//example.com/image.png) xyz; +} + +div { + a14: url("data:image/svg+xml;charset=utf-8,"); +} + +div { + a15: url(data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2042%2026%27%20fill%3D%27%2523007aff%27%3E%3Crect%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%271%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2711%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2712%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3Crect%20y%3D%2722%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%2723%27%20width%3D%2734%27%20height%3D%272%27%2F%3E%3C%2Fsvg%3E); +} + +div { + 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%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 { + a18: url(#highlight); +} + +div { + a19: url(#line-marker); +} + +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,'); +} + +div { + a1: url(); + a114: url(7bc91c245a8a10a4.png); +} + +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%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;} +`; + +exports[`config config/externals/reexport-star exported tests reexport star from external module 1`] = ` +export * from "external1-alias"; +export * from "external2-alias"; + +;// CONCATENATED MODULE: ./case1.js +`; + +exports[`config config/externals/reexport-star exported tests reexport star from external module 2`] = ` +import * as __WEBPACK_EXTERNAL_MODULE_external1_alias__ from "external1-alias"; +export * from "external1-alias"; + +;// CONCATENATED MODULE: external "external1-alias" + +;// CONCATENATED MODULE: ./case2.js + + + + + + +var __webpack_exports__a = __WEBPACK_EXTERNAL_MODULE_external1_alias__.a; +var __webpack_exports__b = __WEBPACK_EXTERNAL_MODULE_external1_alias__.b; +export { __WEBPACK_EXTERNAL_MODULE_external1_alias__ as n1, __webpack_exports__a as a, __webpack_exports__b as b }; +`; + +exports[`config config/externals/reexport-star exported tests reexport star from external module 3`] = ` +import * as __WEBPACK_EXTERNAL_MODULE_external1_alias__ from "external1-alias"; + +;// CONCATENATED MODULE: external "external1-alias" + +;// CONCATENATED MODULE: ./case3/foo.js + +const foo = 2 + +;// CONCATENATED MODULE: ./case3/index.js + +const bar = 1 + +export { bar, foo }; +`; + +exports[`config config/externals/reexport-star exported tests reexport star from external module 4`] = ` +export * from "external1-alias"; + +;// CONCATENATED MODULE: ./case4.js +`; + +exports[`config config/library/modern-module-force-concaten step should pass: .cjs should bail out 1`] = ` +var __webpack_modules__ = ({ +"851": (function (module) { +module.exports = 'b' + +}), + +}); +/************************************************************************/ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + +// Check if module is in cache +var cachedModule = __webpack_module_cache__[moduleId]; +if (cachedModule !== undefined) { +return cachedModule.exports; +} +// Create a new module (and put it into the cache) +var module = (__webpack_module_cache__[moduleId] = { +exports: {} +}); +// Execute the module function +__webpack_modules__[moduleId](module, module.exports, __webpack_require__); + +// Return the exports of the module +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"); +`; + +exports[`config config/library/modern-module-force-concaten step should pass: .cjs should bail out when bundling 1`] = ` +var __webpack_modules__ = ({ +"997": (function (module) { +module.exports = 'bar' + +}), + +}); +/************************************************************************/ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + +// Check if module is in cache +var cachedModule = __webpack_module_cache__[moduleId]; +if (cachedModule !== undefined) { +return cachedModule.exports; +} +// Create a new module (and put it into the cache) +var module = (__webpack_module_cache__[moduleId] = { +exports: {} +}); +// Execute the module function +__webpack_modules__[moduleId](module, module.exports, __webpack_require__); + +// Return the exports of the module +return module.exports; + +} + +/************************************************************************/ +// webpack/runtime/compat_get_default_export +(() => { +// getDefaultExport function for compatibility with non-ESM modules +__webpack_require__.n = function (module) { + var getter = module && module.__esModule ? + function () { return module['default']; } : + function () { return module; }; + __webpack_require__.d(getter, { a: getter }); + return getter; +}; + + + + +})(); +// webpack/runtime/define_property_getters +(() => { +__webpack_require__.d = function(exports, definition) { + for(var key in definition) { + if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); + } + } +}; +})(); +// webpack/runtime/has_own_property +(() => { +__webpack_require__.o = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +})(); +/************************************************************************/ + +;// CONCATENATED MODULE: ./e/foo.js +const foo = 'foo' + +// EXTERNAL MODULE: ./e/bar.cjs +var bar = __webpack_require__("997"); +var bar_default = /*#__PURE__*/__webpack_require__.n(bar); +;// CONCATENATED MODULE: ./e/index.js + + + + + +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: ESM export should concat 1`] = ` +;// CONCATENATED MODULE: ./a.js +const a = 'a' + +export { a }; +`; + +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"; +var __webpack_modules__ = ({ +"17": (function (module) { +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); + +}), +"441": (function (module, __unused_webpack_exports, __webpack_require__) { +const path = __webpack_require__(17) + +module.exports = pathXsep + + +}), + +}); +/************************************************************************/ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + +// Check if module is in cache +var cachedModule = __webpack_module_cache__[moduleId]; +if (cachedModule !== undefined) { +return cachedModule.exports; +} +// Create a new module (and put it into the cache) +var module = (__webpack_module_cache__[moduleId] = { +exports: {} +}); +// Execute the module function +__webpack_modules__[moduleId](module, module.exports, __webpack_require__); + +// Return the exports of the module +return module.exports; + +} + +/************************************************************************/ +// webpack/runtime/compat_get_default_export +(() => { +// getDefaultExport function for compatibility with non-ESM modules +__webpack_require__.n = function (module) { + var getter = module && module.__esModule ? + function () { return module['default']; } : + function () { return module; }; + __webpack_require__.d(getter, { a: getter }); + return getter; +}; + + + + +})(); +// webpack/runtime/define_property_getters +(() => { +__webpack_require__.d = function(exports, definition) { + for(var key in definition) { + if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); + } + } +}; +})(); +// webpack/runtime/has_own_property +(() => { +__webpack_require__.o = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +})(); +/************************************************************************/ + +// EXTERNAL MODULE: ./f/bar.cjs +var bar = __webpack_require__("441"); +var bar_default = /*#__PURE__*/__webpack_require__.n(bar); +;// CONCATENATED MODULE: ./f/foo.js +const foo = 'foo' + +;// CONCATENATED MODULE: ./f/index.js + + + +const value = foo + (bar_default()) + + + +export { value }; +`; + +exports[`config config/library/modern-module-force-concaten step should pass: harmony export should concat, even with bailout reason 1`] = ` +var __webpack_modules__ = ({ +"974": (function (module) { +module.exports = 'foo' + + +}), + +}); +/************************************************************************/ +// The module cache +var __webpack_module_cache__ = {}; + +// The require function +function __webpack_require__(moduleId) { + +// Check if module is in cache +var cachedModule = __webpack_module_cache__[moduleId]; +if (cachedModule !== undefined) { +return cachedModule.exports; +} +// Create a new module (and put it into the cache) +var module = (__webpack_module_cache__[moduleId] = { +exports: {} +}); +// Execute the module function +__webpack_modules__[moduleId](module, module.exports, __webpack_require__); + +// Return the exports of the module +return module.exports; + +} + +/************************************************************************/ +// webpack/runtime/compat_get_default_export +(() => { +// getDefaultExport function for compatibility with non-ESM modules +__webpack_require__.n = function (module) { + var getter = module && module.__esModule ? + function () { return module['default']; } : + function () { return module; }; + __webpack_require__.d(getter, { a: getter }); + return getter; +}; + + + + +})(); +// webpack/runtime/define_property_getters +(() => { +__webpack_require__.d = function(exports, definition) { + for(var key in definition) { + if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { + Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); + } + } +}; +})(); +// webpack/runtime/has_own_property +(() => { +__webpack_require__.o = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +})(); +/************************************************************************/ + +// EXTERNAL MODULE: ./g/foo.js +var foo = __webpack_require__("974"); +var foo_default = /*#__PURE__*/__webpack_require__.n(foo); +;// CONCATENATED MODULE: ./g/index.js + + + + +var __webpack_exports__foo = (foo_default()); +export { __webpack_exports__foo as foo }; +`; + +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-swc-extract-comments exported tests should keep the extracted license file stable 1`] = ` +/** + * bar + * @license MIT + */ + +/** + * baz + * @license MIT + */ + +/** + * foo + * @license MIT + */ + +/** + * relative + * @license MIT + */ +`; + +exports[`config config/plugins/chunk-modules exported tests chunk-modules 1`] = ` +Object { + 515: Object { + entryModules: Array [], + modules: Array [ + Object { + context: , + identifier: /async.js, + resource: /async.js, + }, + ], + }, + 909: Object { + entryModules: Array [ + Object { + context: , + identifier: /index.js, + resource: /index.js, + }, + ], + modules: Array [ + Object { + context: , + identifier: /index.js, + resource: /index.js, + }, + Object { + identifier: external node-commonjs "fs", + }, + Object { + identifier: external node-commonjs "path", + }, + ], + }, +} +`; + +exports[`config config/schemes/data-imports exported tests data imports 1`] = ` +.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{color: green} */ + + + +.class { + a: url(7159cadb6967ca3cXsvg); + b: url(7159cadb6967ca3cXsvg); + c: url(7159cadb6967ca3c); + d: url(7159cadb6967ca3c); +} + +head{--webpack--909:&_653,Ā47ĄĀ645ą_49Ď571;} +`; 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 3524c92a184..bf6033f918f 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/StatsAPI.test.js.snap @@ -1406,7 +1406,109 @@ Object { } `; -exports[`statsAPI statsAPI/ids should have ids when ids is true 1`] = `undefined`; +exports[`statsAPI statsAPI/ids should have ids when ids is true 1`] = ` +Object { + 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 {}, + }, + name: main.js, + size: 207, + type: asset, + }, + ], + assetsByChunkName: Object { + main: Array [ + main.js, + ], + }, + chunks: Array [ + Object { + auxiliaryFiles: Array [], + childrenByOrder: Object {}, + entry: true, + files: Array [ + main.js, + ], + hash: 27a83dfdb1b13db8, + id: 909, + idHints: Array [], + initial: true, + names: Array [ + main, + ], + reason: undefined, + rendered: true, + runtime: Array [ + main, + ], + size: 55, + sizes: Object { + javascript: 55, + }, + type: chunk, + }, + ], + 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, + }, + type: module, + warnings: 0, + }, + ], +} +`; exports[`statsAPI statsAPI/layer-stats should have module layer 1`] = ` Object { @@ -1438,4 +1540,719 @@ Object { } `; -exports[`statsAPI statsAPI/with-query should output stats with query 1`] = `undefined`; +exports[`statsAPI statsAPI/with-query should output stats with query 1`] = ` +Object { + 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 {}, + }, + isOverSizeLimit: false, + name: main.js, + related: Array [], + size: 346, + type: asset, + }, + ], + assetsByChunkName: Object { + main: Array [ + main.js, + ], + }, + children: Array [], + chunks: Array [ + Object { + auxiliaryFiles: Array [], + children: Array [], + childrenByOrder: Object {}, + entry: true, + files: Array [ + main.js, + ], + filteredModules: undefined, + hash: b7f0963e6f214dbb, + id: 909, + idHints: Array [], + initial: true, + modules: Array [ + Object { + 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 [ + Object { + 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, + }, + ], + 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, + }, + 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, + }, + ], + size: 55, + sizes: Object { + javascript: 55, + }, + 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: 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, + }, + ], + 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, + }, + 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, + }, + ], + size: 55, + sizes: Object { + javascript: 55, + }, + 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: 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, + ], + reasons: Array [ + Object { + moduleId: null, + resolvedModuleId: null, + type: entry, + userRequest: ./fixtures/abc-query, + }, + ], + 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, + }, + Object { + 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 [ + Object { + 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, + 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, + }, + 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, + }, + ], + size: 72, + sizes: Object { + javascript: 72, + }, + source: module.exports = function b() { + require("./a"); + return "This is c"; +};, + type: module, + usedExports: null, + warnings: 0, + }, + ], + names: Array [ + main, + ], + origins: Array [ + Object { + loc: main, + module: , + moduleId: undefined, + moduleIdentifier: , + moduleName: , + request: ./fixtures/abc-query, + }, + ], + parents: Array [], + reason: undefined, + rendered: true, + runtime: Array [ + main, + ], + siblings: Array [], + size: 281, + sizes: Object { + javascript: 281, + }, + type: chunk, + }, + ], + entrypoints: Object { + main: Object { + assets: Array [ + Object { + name: main.js, + size: 346, + }, + ], + 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: 90c6d1b3d1b7dc71, + 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-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, + }, + ], + 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, + }, + 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 [ + Object { + 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, + 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, + }, + 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, + }, + ], + size: 55, + sizes: Object { + javascript: 55, + }, + 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 [ + Object { + 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, + 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, + }, + 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, + }, + ], + size: 72, + sizes: Object { + javascript: 72, + }, + 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 [ + Object { + 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, + }, + ], + 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, + }, + 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, + }, + ], + size: 55, + sizes: Object { + javascript: 55, + }, + source: module.exports = function a() { + return "This is a"; +};, + type: module, + usedExports: null, + warnings: 0, + }, + ], + namedChunkGroups: Object { + main: Object { + assets: Array [ + Object { + name: main.js, + size: 346, + }, + ], + 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, +} +`;