diff --git a/Cargo.lock b/Cargo.lock index d792d1078fa..a96cb8d2deb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,9 +318,9 @@ dependencies = [ [[package]] name = "better_scoped_tls" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de" +checksum = "297b153aa5e573b5863108a6ddc9d5c968bd0b20e75cc614ee9821d2f45679c7" dependencies = [ "scoped-tls", ] @@ -1700,9 +1700,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hstr" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96274be293b8877e61974a607105d09c84caebe9620b47774aa8a6b942042dd4" +checksum = "dae404c0c5d4e95d4858876ab02eecd6a196bb8caa42050dfa809938833fc412" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", @@ -3264,9 +3264,9 @@ checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", @@ -3283,9 +3283,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -4991,9 +4991,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.289.0" +version = "0.290.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc980445efce78dfdbfc8bbe5b54e9657fd1acdac7c6d94442b27bbbb1a3a23" +checksum = "65928b3a6abe08e6b49d5c55ffa079e973e62796ad4e2ffaaa1df12068141d12" dependencies = [ "anyhow", "base64 0.21.7", @@ -5044,9 +5044,9 @@ dependencies = [ [[package]] name = "swc_allocator" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc8bd3075d1c6964010333fae9ddcd91ad422a4f8eb8b3206a9b2b6afb4209e" +checksum = "76aa0eb65c0f39f9b6d82a7e5192c30f7ac9a78f084a21f270de1d8c600ca388" dependencies = [ "bumpalo", "hashbrown 0.14.5", @@ -5057,9 +5057,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0963b5f4cb08353dd4a386c7b5ee1c99d5a097722cdbc6a522efb2aeb91aad71" +checksum = "b25ff0f3fd48ab1a95d86fd0505fdd1ac904f84d0350dc8222bbc824e9d4fdf6" dependencies = [ "bytecheck", "hstr", @@ -5085,9 +5085,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.40.0" +version = "0.40.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fca87acdd34580b59a6f6686dfe72bcc7bad4b7abb7e6728e8e3fd4ecb1d7c" +checksum = "ca32839a37f3b12213b18623b1bd58d37641cab750c50c3c287876cb98b12ab4" dependencies = [ "ahash 0.8.11", "anyhow", @@ -5117,9 +5117,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b82e7c3cc5954a5b2e9c545920232a1d37a70215719f5021f090eda9fcf88a" +checksum = "8e70a05e62eaf316a0ba25aaaacfaa009b12f69d91cbe6b345ca295ecd1f3912" dependencies = [ "anyhow", "base64 0.21.7", @@ -5170,9 +5170,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.106.0" +version = "0.109.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e99f5a654203ac30e8b819a7c36a913d7620210ef43d7ca04e1269bbd17781" +checksum = "bd02d43362c4bf75983f4c1f3986a5524fe46c42c707a4c79bc2bbdeffc2926a" dependencies = [ "swc", "swc_allocator", @@ -5198,9 +5198,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.121.0" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628b2c0c6349c1960b007fda04e0c1537480e0d0b1405305ef5846b752aa7a8" +checksum = "84d568834a727fc06c608db119dcea52c2d58e9426e92e72f358e2f7dc847063" dependencies = [ "bitflags 2.5.0", "bytecheck", @@ -5218,9 +5218,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.158.0" +version = "0.158.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aef555943803034f0e0fd98ddfe72f1c3454f2c68a897075eb29bc63d4e930" +checksum = "9f165ad337476063bd66aca63a46bcde88ccfb772ee6a748f57afe52cc543fa8" dependencies = [ "memchr", "num-bigint", @@ -5250,9 +5250,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "0.16.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff0f4ede38d4110f8c639a4c07c8d2b677d3eac968ab33da312bbaf6ad5adf0" +checksum = "204c0589ec432f795f3e38574244163d2288a0444ce7f499aa0b256a2346aeea" dependencies = [ "swc_atoms", "swc_common", @@ -5267,9 +5267,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a479b2061a3b2c939a9abd34cfd3e9a6983a8bf12f7d3da89ac7ad6a64d9a4" +checksum = "eaa58f04f0ede7d44939974aa0795198aedb4a021cb0e56a977465f5a9ee6832" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5280,9 +5280,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "0.16.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129fa363e3ea01f9e2d2dbd06675bfd515689b261c28b30296d89c91b549916a" +checksum = "193d25320c12f73f111bd12159519d2fa3aeb3d15cbb1f729882d48e71ce2443" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -5307,9 +5307,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0f1dd466100cd41e85be398d1f4d973f8d5760ec52376294918def88e620ad" +checksum = "a17adff62889cac35a5ac6099777ae20eaef603d0052c1a0e3ef8ac45412a543" dependencies = [ "swc_atoms", "swc_common", @@ -5324,9 +5324,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a3fcc3ae30628fc752d04b44c885ea6202ecfb187311d8827cc851ba7d906d" +checksum = "8a4f3c82273be28af3fb96e6b9a0f60218923c5923189e7f04050586be83e05b" dependencies = [ "serde", "swc_atoms", @@ -5342,9 +5342,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31160d66339dda14faefd3a2816a0436f0a1e4f33a2057d8f3663a1a567eaf2e" +checksum = "8dbed7700a811364d673ddaa4b2aa2e40033baa0264fc4dafbd67c08a711833a" dependencies = [ "serde", "swc_atoms", @@ -5361,9 +5361,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f0164ad462c81c421de2af75f408ca3a96324a3c5e81d999a90a58e6e40dbef" +checksum = "abe53062abdd2f87154b26f0f3765ab68eec50156d2a2533fc6f23f21db33fbf" dependencies = [ "swc_atoms", "swc_common", @@ -5377,9 +5377,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da49ae2565352c179657b47e87b4879b8c1128b5447e8fbfaaa020702f740636" +checksum = "fd7c21f8d2dcdf78985663662ac100ffa901f7d9cb262c8fb249e76878e5da39" dependencies = [ "serde", "swc_atoms", @@ -5395,9 +5395,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9fed665a9f5b2b3c55fc04f36b12c8d2148fd25fb216a4d9ae9fac331a5374" +checksum = "132b4140f0f95fac85bb0185b729b803549ee10163164ee0ea8dbcb890d6e223" dependencies = [ "swc_atoms", "swc_common", @@ -5411,9 +5411,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "0.16.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241bf311a26447690bbfc36ec76886dac04343f82e3fe638fc0e0cdbaeae534b" +checksum = "9b8606eb5adf4254a9b7bc9c53c3f3337799f7dcf8f574105adba65ce5172ed7" dependencies = [ "swc_atoms", "swc_common", @@ -5430,9 +5430,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0c7867bba0129c8844cf274c9a0e3f1926d7225d6dce36343a4b1626399992" +checksum = "7238859b1243c22bad33513cf5e9f2191fc8205719c727b665f7fd55efed1706" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5445,9 +5445,9 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "0.123.0" +version = "0.124.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ea0bdb96b8d24305cf23614db4c734425c44329bd6e1734e6ebd068a88b536" +checksum = "d71495487d393475642215ddc1afaf4979f46d16f0fecc5f0f9869f99734ff61" dependencies = [ "phf 0.11.2", "swc_atoms", @@ -5459,9 +5459,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.104.0" +version = "0.105.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379e2cdec549c72be03de081b0dee7a08254a50ae22a8907837f91e5f4e8b6eb" +checksum = "f2ee5ef22a767fac434d07ab4a0d161d8a1e91a1bcd9e9fab1b360dae98a3194" dependencies = [ "auto_impl", "dashmap 5.5.3", @@ -5479,9 +5479,9 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.52.0" +version = "0.52.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a4a7d650e26ebf0d3b0a5a80c8d893f80a44a79cb5129c75841a9cb8b48805" +checksum = "f521eea3476abc7ae7adcbfa3479881087e5ae8fe358d46376d761e83fdb3120" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5501,9 +5501,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.208.0" +version = "0.209.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65d350bcb52551bd71df44084ab69a21fa2cf41216c7677d16d75e490d9ef51" +checksum = "fa35b96d91b65651b79915ea48cef73cd2d81239eeb5b4fdd6492fe923e145fc" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -5537,9 +5537,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.152.0" +version = "0.152.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef96894fa0fb3fba233ede22a75a7ddd8b7f0727a40aa8d1028b5dd25013d2e" +checksum = "b888663998ef49da15d1dd3377e6b62bab4f994588e4f405628cb058d11ce8b3" dependencies = [ "either", "new_debug_unreachable", @@ -5559,9 +5559,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.221.0" +version = "0.222.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b6b5a7222fe85be1732faa7a2c9812fc516d934ba320662c90c066264cd9eec" +checksum = "1ca373759c7247341c18ce0632a46f3cff8d537cbcfd006a1445d3c328f241ce" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -5601,9 +5601,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.243.0" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b22f584075dfbd349c107def9c52de654979f0a1e8cdc4255dd4e7ec5b39800" +checksum = "b73549ef9f33d8a175244169b554fde9cd669d331b7090b64c02146147ee0c33" dependencies = [ "swc_atoms", "swc_common", @@ -5621,9 +5621,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.149.0" +version = "0.150.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2194d20416a03ae02058934f8387691809f86466a2f2e7a65c56dcb001bd46b" +checksum = "867ae73ffc2ae8cad72651f3b02017131379860e8687e9fae4b1e25da7d91cf1" dependencies = [ "better_scoped_tls", "bitflags 2.5.0", @@ -5645,9 +5645,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.138.0" +version = "0.139.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e93ef88e45587864ef645e29c33f04f75360e47194c084f931855af3aac246" +checksum = "6ecbb88f0256ce6e0fdc69be5da1af089b1ae33f9923f716726b65203428b7ed" dependencies = [ "swc_atoms", "swc_common", @@ -5659,9 +5659,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.175.0" +version = "0.176.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35dd174f6c954a4fe1bff88a64de777ef65041411f96b60daf4a78864ad47789" +checksum = "54a83188f4f8d7dc06ac0606bb698d1075ffe47c23e83c02dacccfb71d3bcf68" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -5707,9 +5707,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.194.0" +version = "0.195.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b9adad7fabecb58e786d245087bd09f7c07693927a87d15e13aecfe4c4f13ee" +checksum = "933221b7c1b8468c885eda2a3ad625d58d1f8259542166f35707a03313fbcdc7" dependencies = [ "Inflector", "anyhow", @@ -5734,9 +5734,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.212.0" +version = "0.213.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "454df4c54d0ff859b10e33168c9101f805ca8ee0deb11b71b0380fa6ce844438" +checksum = "831fa5251fed6d737a3ed4887ceb0a21ca392ebbdd6fb6de00bf8edf48bc86f4" dependencies = [ "dashmap 5.5.3", "indexmap 2.2.6", @@ -5759,9 +5759,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.183.0" +version = "0.184.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718f1e24dd96cfb0b7ba8f8a4e61c98338cdac7a3f5f9f4a83951d776ac398bf" +checksum = "c7279bc3f706a91d236b0233eb57441809402cd533cf866235c4c66b4f562c82" dependencies = [ "either", "rustc-hash 1.1.0", @@ -5779,9 +5779,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.195.0" +version = "0.196.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ddcb8943976319a4f8b899862f094f6984511490e4bfa9b4c8fbd334539b62" +checksum = "a2874f29c9acacc2ac3d20de5c1ff207f2eb68b536cc7655a6e29874895f6adc" dependencies = [ "base64 0.21.7", "dashmap 5.5.3", @@ -5804,9 +5804,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.202.0" +version = "0.203.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bfb758c4335038fd27668c17fb174ee18cd96c305a43fe38cc890f57cc6d395" +checksum = "ea45a4c1332c93de14226c621ea4cb7ac5e0f874142824b21653c6f34cf719f0" dependencies = [ "ryu-js", "serde", @@ -5821,9 +5821,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.33.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a1d8b627b6adc706ccd2a4a30a5413e9df91a9cff6569cb9d3b9f41c1bc8de" +checksum = "67cf63780f8abfcebdea8a0d6018575b09d7aac5c2ec778f12fe6dc09d27c6a5" dependencies = [ "indexmap 2.2.6", "rustc-hash 1.1.0", @@ -5838,9 +5838,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.137.0" +version = "0.138.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "939f21c75eff61ad3e485fc54d38988f2f9744ceda24a3feb8228dd072171d94" +checksum = "41f6422008758309fb2ab79ddbbf0e635bb69e47e54196b89f00a0217e820620" dependencies = [ "indexmap 2.2.6", "num_cpus", @@ -5858,9 +5858,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.107.0" +version = "0.107.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bd17e03251272ee04d1155036be5288055ab43d40ab2d9fd63ff815d326dad" +checksum = "b5983d63df36fdefec8b4bdb88d1fdcd06c9acb815d987c871409a5a64d58f63" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -5897,9 +5897,9 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3daff8d4379be2a99ab4b146e4dd631ef2415965dc4f1d33e988a737c5ccc39a" +checksum = "7f5910e7aeb1e0125ad27be9346cc266d1c75b68b6dc57ca37921136f4758416" dependencies = [ "indexmap 2.2.6", "petgraph", @@ -5909,9 +5909,9 @@ dependencies = [ [[package]] name = "swc_html" -version = "0.153.0" +version = "0.154.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f863582fbfa3a697524de06a6065d1047427ac30a1e2dfce56bacf7cbc1ab69" +checksum = "8c0c6906d7491088ed55808ff89f4ca90ca40d3c5f5e047f86d4b6e8290f2e39" dependencies = [ "swc_html_ast", "swc_html_codegen", @@ -5921,9 +5921,9 @@ dependencies = [ [[package]] name = "swc_html_ast" -version = "0.40.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8139ad05939c4932798550b5ab50405825ee2c6c316e9173ef2d8a1e9b11d" +checksum = "ac72067766823374b7d0fdbcf5b8b72d118158a02edb1632a6f84984b2669407" dependencies = [ "is-macro", "string_enum", @@ -5961,9 +5961,9 @@ dependencies = [ [[package]] name = "swc_html_minifier" -version = "0.150.0" +version = "0.151.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e7a15b6c9e6eddc187fdc8a09f84e69b9d45db81c17d3d0935654e31f7f629" +checksum = "a36dc687aac7c84b9a34b0ec6dc2e2d0077e9065b237a3253cf4b624d1e1c56f" dependencies = [ "once_cell", "serde", @@ -6058,9 +6058,9 @@ dependencies = [ [[package]] name = "swc_plugin_proxy" -version = "0.50.0" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d1ff72008f9a4dd53b5b79f64057a59bedb3245ae17165fa8aece8b2da4782" +checksum = "62a0c7f6098cb0ea5d0191bc02c5b3705000f2dd94c6da31f3ac47adf77ae419" dependencies = [ "better_scoped_tls", "rkyv", @@ -6072,9 +6072,9 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "0.115.0" +version = "0.115.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521a0936cc2241ea4adbf32a1bcace5b9b3d594be93f302d8a87bd305fde0a05" +checksum = "1f80055db238f44ab2741e5ee7a65aa54d8c1c3b1f9138fbd6b361eb8466a9c5" dependencies = [ "anyhow", "enumset", @@ -6131,9 +6131,9 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b61f86dce2eeabd85d934a89cd481709918c751c44dfe433b5e4f1f40075fb5a" +checksum = "62f67e7bf045807f80a6b07d3acf3098db27bb3c82c93cc46eaf78ba386be950" dependencies = [ "swc_atoms", "swc_common", diff --git a/Cargo.toml b/Cargo.toml index c643b87415e..78cfbc7ae7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,11 +75,11 @@ napi-derive = { version = "2" } # Must be pinned with the same swc versions #rkyv = { version = "=0.7.44" } # synced with swc wasm plugin swc_config = { version = "=0.1.15" } -swc_core = { version = "=0.106.0", default-features = false } -swc_ecma_minifier = { version = "=0.208.0", default-features = false } +swc_core = { version = "=0.109.1", default-features = false } +swc_ecma_minifier = { version = "=0.209.1", default-features = false } swc_error_reporters = { version = "=1.0.0" } -swc_html = { version = "=0.153.0" } -swc_html_minifier = { version = "=0.150.0", default-features = false } +swc_html = { version = "=0.154.0" } +swc_html_minifier = { version = "=0.151.0", default-features = false } swc_node_comments = { version = "=0.27.0" } rspack_dojang = { version = "0.1.9" } diff --git a/crates/node_binding/binding.d.ts b/crates/node_binding/binding.d.ts index 9f7cc0070bc..b40897b1e85 100644 --- a/crates/node_binding/binding.d.ts +++ b/crates/node_binding/binding.d.ts @@ -682,6 +682,7 @@ export interface JsModule { factoryMeta?: JsFactoryMeta type: string layer?: string + useSourceMap?: boolean } export interface JsModuleDescriptor { @@ -712,6 +713,7 @@ export interface JsPathData { url?: string id?: string chunk?: JsChunkPathData + contentHashType?: string } export interface JsResolveArgs { @@ -1438,6 +1440,26 @@ export interface RawJavascriptParserOptions { worker?: Array overrideStrict?: string importMeta?: boolean + /** + * This option is experimental in Rspack only and subject to change or be removed anytime. + * @experimental + */ + requireAsExpression?: boolean + /** + * This option is experimental in Rspack only and subject to change or be removed anytime. + * @experimental + */ + requireDynamic?: boolean + /** + * This option is experimental in Rspack only and subject to change or be removed anytime. + * @experimental + */ + requireResolve?: boolean + /** + * This option is experimental in Rspack only and subject to change or be removed anytime. + * @experimental + */ + importDynamic?: boolean } export interface RawLazyCompilationOption { diff --git a/crates/node_binding/package.json b/crates/node_binding/package.json index 06485667cae..cea835a1223 100644 --- a/crates/node_binding/package.json +++ b/crates/node_binding/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/binding", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "Node binding for rspack", "main": "binding.js", diff --git a/crates/rspack_binding_options/src/options/raw_module/mod.rs b/crates/rspack_binding_options/src/options/raw_module/mod.rs index ae6d1422b18..e617bb8475d 100644 --- a/crates/rspack_binding_options/src/options/raw_module/mod.rs +++ b/crates/rspack_binding_options/src/options/raw_module/mod.rs @@ -272,6 +272,18 @@ pub struct RawJavascriptParserOptions { pub worker: Option>, pub override_strict: Option, pub import_meta: Option, + /// This option is experimental in Rspack only and subject to change or be removed anytime. + /// @experimental + pub require_as_expression: Option, + /// This option is experimental in Rspack only and subject to change or be removed anytime. + /// @experimental + pub require_dynamic: Option, + /// This option is experimental in Rspack only and subject to change or be removed anytime. + /// @experimental + pub require_resolve: Option, + /// This option is experimental in Rspack only and subject to change or be removed anytime. + /// @experimental + pub import_dynamic: Option, } impl From for JavascriptParserOptions { @@ -307,6 +319,10 @@ impl From for JavascriptParserOptions { .override_strict .map(|e| OverrideStrict::from(e.as_str())), import_meta: value.import_meta, + require_as_expression: value.require_as_expression, + require_dynamic: value.require_dynamic, + require_resolve: value.require_resolve, + import_dynamic: value.import_dynamic, } } } diff --git a/crates/rspack_binding_values/src/compilation/mod.rs b/crates/rspack_binding_values/src/compilation/mod.rs index a60724ebd93..39ca50a1531 100644 --- a/crates/rspack_binding_values/src/compilation/mod.rs +++ b/crates/rspack_binding_values/src/compilation/mod.rs @@ -390,7 +390,7 @@ impl JsCompilation { let chunk = data.chunk.as_ref().map(|c| c.to_chunk(self.0)); self .0 - .get_asset_path(&filename.into(), data.as_core_path_data(chunk.as_ref())) + .get_asset_path(&filename.into(), data.to_path_data(chunk.as_ref())) } #[napi] @@ -402,7 +402,7 @@ impl JsCompilation { let chunk = data.chunk.as_ref().map(|c| c.to_chunk(self.0)); let path_and_asset_info = self .0 - .get_asset_path_with_info(&filename.into(), data.as_core_path_data(chunk.as_ref()))?; + .get_asset_path_with_info(&filename.into(), data.to_path_data(chunk.as_ref()))?; Ok(path_and_asset_info.into()) } @@ -411,7 +411,7 @@ impl JsCompilation { let chunk = data.chunk.as_ref().map(|c| c.to_chunk(self.0)); self .0 - .get_path(&filename.into(), data.as_core_path_data(chunk.as_ref())) + .get_path(&filename.into(), data.to_path_data(chunk.as_ref())) } #[napi] @@ -423,7 +423,7 @@ impl JsCompilation { let chunk = data.chunk.as_ref().map(|c| c.to_chunk(self.0)); let path_and_asset_info = self .0 - .get_path_with_info(&filename.into(), data.as_core_path_data(chunk.as_ref()))?; + .get_path_with_info(&filename.into(), data.to_path_data(chunk.as_ref()))?; Ok(path_and_asset_info.into()) } diff --git a/crates/rspack_binding_values/src/filename.rs b/crates/rspack_binding_values/src/filename.rs index ddaa369b1db..6442b8499f2 100644 --- a/crates/rspack_binding_values/src/filename.rs +++ b/crates/rspack_binding_values/src/filename.rs @@ -91,9 +91,10 @@ impl LocalFilenameFn for ThreadSafeFilenameFn { &self, path_data: &PathData, asset_info: Option<&AssetInfo>, + hash_digest_length: usize, ) -> rspack_error::Result { self.0.blocking_call_with_sync(( - JsPathData::from(*path_data), + JsPathData::from_path_data(*path_data, hash_digest_length), asset_info.cloned().map(JsAssetInfo::from), )) } @@ -110,8 +111,9 @@ impl LocalFilenameFn for LocalJsFilenameFn { &self, path_data: &PathData, asset_info: Option<&AssetInfo>, + hash_digest_length: usize, ) -> Result { - let js_path_data = JsPathData::from(*path_data); + let js_path_data = JsPathData::from_path_data(*path_data, hash_digest_length); let js_asset_info = asset_info.cloned().map(JsAssetInfo::from); self.0.call2(js_path_data, js_asset_info) } diff --git a/crates/rspack_binding_values/src/module.rs b/crates/rspack_binding_values/src/module.rs index 600e91d4f9d..f6ca33fb29f 100644 --- a/crates/rspack_binding_values/src/module.rs +++ b/crates/rspack_binding_values/src/module.rs @@ -331,6 +331,7 @@ pub struct JsModule { pub factory_meta: Option, pub r#type: String, pub layer: Option, + pub use_source_map: Option, } pub trait ToJsModule { @@ -368,6 +369,7 @@ impl ToJsModule for dyn Module { .map(|factory_meta| JsFactoryMeta { side_effect_free: factory_meta.side_effect_free, }), + ..Default::default() }) .or_else(|_| { self.try_as_raw_module().map(|_| JsModule { @@ -375,13 +377,9 @@ impl ToJsModule for dyn Module { r#type: module_type(), layer: module_layer(), original_source: original_source(), - resource: None, module_identifier: module_identifier(), name_for_condition: name_for_condition(), - raw_request: None, - user_request: None, - request: None, - factory_meta: None, + ..Default::default() }) }) .or_else(|_| { @@ -390,13 +388,9 @@ impl ToJsModule for dyn Module { original_source: original_source(), r#type: module_type(), layer: module_layer(), - resource: None, module_identifier: module_identifier(), name_for_condition: name_for_condition(), - raw_request: None, - user_request: None, - request: None, - factory_meta: None, + ..Default::default() }) }) .or_else(|_| { @@ -405,13 +399,9 @@ impl ToJsModule for dyn Module { original_source: original_source(), r#type: module_type(), layer: module_layer(), - resource: None, module_identifier: module_identifier(), name_for_condition: name_for_condition(), - raw_request: None, - user_request: None, - request: None, - factory_meta: None, + ..Default::default() }) }) .or_else(|_| { @@ -443,6 +433,7 @@ impl ToJsModule for CompilerModuleContext { factory_meta: self.factory_meta.as_ref().map(|fm| JsFactoryMeta { side_effect_free: fm.side_effect_free, }), + use_source_map: Some(self.use_source_map), }; Ok(module) } diff --git a/crates/rspack_binding_values/src/path_data.rs b/crates/rspack_binding_values/src/path_data.rs index 60669dab292..234f85fe570 100644 --- a/crates/rspack_binding_values/src/path_data.rs +++ b/crates/rspack_binding_values/src/path_data.rs @@ -16,10 +16,11 @@ pub struct JsPathData { pub url: Option, pub id: Option, pub chunk: Option, + pub content_hash_type: Option, } -impl From> for JsPathData { - fn from(path_data: rspack_core::PathData<'_>) -> Self { +impl JsPathData { + pub fn from_path_data(path_data: rspack_core::PathData, hash_digest_length: usize) -> JsPathData { Self { filename: path_data.filename.map(|s| s.to_string()), hash: path_data.hash.map(|s| s.to_string()), @@ -27,7 +28,10 @@ impl From> for JsPathData { runtime: path_data.runtime.map(|s| s.to_string()), url: path_data.url.map(|s| s.to_string()), id: path_data.id.map(|s| s.to_string()), - chunk: path_data.chunk.map(JsChunkPathData::from), + chunk: path_data + .chunk + .map(|c| JsChunkPathData::from_chunk(c, hash_digest_length)), + content_hash_type: path_data.content_hash_type.map(|c| c.to_string()), } } } @@ -37,7 +41,6 @@ pub struct JsChunkPathData { pub id: Option, pub name: Option, pub hash: Option, - // TODO: support custom content hash type pub content_hash: Option>>, } @@ -48,28 +51,24 @@ impl JsChunkPathData { chunk.hash = self .hash .clone() - .map(|s| RspackHashDigest::new(s.into(), &compilation.options.output.hash_digest)); + .map(|s| RspackHashDigest::from(s.as_str())); - chunk.rendered_hash = self.hash.as_ref().map(|d| { - if d.len() < compilation.options.output.hash_digest_length { - d.as_str().into() - } else { - d[..compilation.options.output.hash_digest_length].into() - } + chunk.rendered_hash = chunk.hash.as_ref().map(|h| { + h.rendered(compilation.options.output.hash_digest_length) + .into() }); if let Some(hash) = self.content_hash.as_ref() { match hash { Either::A(hash) => { - chunk.content_hash.insert( - SourceType::Unknown, - RspackHashDigest::new(hash.clone().into(), &compilation.options.output.hash_digest), - ); + chunk + .content_hash + .insert(SourceType::Unknown, RspackHashDigest::from(hash.as_str())); } Either::B(map) => { for (key, hash) in map { chunk.content_hash.insert( SourceType::from(key.as_str()), - RspackHashDigest::new(hash.clone().into(), &compilation.options.output.hash_digest), + RspackHashDigest::from(hash.as_str()), ); } } @@ -77,10 +76,8 @@ impl JsChunkPathData { } chunk } -} -impl<'a> From<&'a rspack_core::Chunk> for JsChunkPathData { - fn from(chunk: &'a rspack_core::Chunk) -> Self { + fn from_chunk(chunk: &rspack_core::Chunk, hash_digest_length: usize) -> JsChunkPathData { Self { id: chunk.id.clone(), name: chunk.name.clone(), @@ -89,7 +86,7 @@ impl<'a> From<&'a rspack_core::Chunk> for JsChunkPathData { chunk .content_hash .iter() - .map(|(key, v)| (key.to_string(), v.encoded().to_string())) + .map(|(key, v)| (key.to_string(), v.rendered(hash_digest_length).to_string())) .collect(), )), } @@ -97,10 +94,15 @@ impl<'a> From<&'a rspack_core::Chunk> for JsChunkPathData { } impl JsPathData { - pub fn as_core_path_data<'a>( + pub fn to_path_data<'a>( &'a self, chunk: Option<&'a rspack_core::Chunk>, ) -> rspack_core::PathData<'a> { + let content_hash_type = self + .content_hash_type + .as_ref() + .map(|v| SourceType::from(v.as_str())); + rspack_core::PathData { filename: self.filename.as_deref(), chunk, @@ -112,6 +114,7 @@ impl JsPathData { runtime: self.runtime.as_deref(), url: self.url.as_deref(), id: self.id.as_deref(), + content_hash_type, } } } diff --git a/crates/rspack_core/src/compiler/compilation.rs b/crates/rspack_core/src/compiler/compilation.rs index 4e946cb4db3..f39849721bc 100644 --- a/crates/rspack_core/src/compiler/compilation.rs +++ b/crates/rspack_core/src/compiler/compilation.rs @@ -1758,7 +1758,7 @@ impl Compilation { if data.hash.is_none() { data.hash = self.get_hash(); } - filename.render(data, None) + filename.render(data, None, self.options.output.hash_digest_length) } pub fn get_path_with_info<'b, 'a: 'b, F: LocalFilenameFn>( @@ -1770,7 +1770,11 @@ impl Compilation { if data.hash.is_none() { data.hash = self.get_hash(); } - let path = filename.render(data, Some(&mut info))?; + let path = filename.render( + data, + Some(&mut info), + self.options.output.hash_digest_length, + )?; Ok((path, info)) } @@ -1779,7 +1783,7 @@ impl Compilation { filename: &Filename, data: PathData, ) -> Result { - filename.render(data, None) + filename.render(data, None, self.options.output.hash_digest_length) } pub fn get_asset_path_with_info( @@ -1788,7 +1792,11 @@ impl Compilation { data: PathData, ) -> Result<(String, AssetInfo), F::Error> { let mut info = AssetInfo::default(); - let path = filename.render(data, Some(&mut info))?; + let path = filename.render( + data, + Some(&mut info), + self.options.output.hash_digest_length, + )?; Ok((path, info)) } diff --git a/crates/rspack_core/src/external_module.rs b/crates/rspack_core/src/external_module.rs index 0bdca278c0e..74f3560c789 100644 --- a/crates/rspack_core/src/external_module.rs +++ b/crates/rspack_core/src/external_module.rs @@ -128,7 +128,6 @@ fn resolve_external_type<'a>( external_type: &'a str, dependency_meta: &'a DependencyMeta, ) -> &'a str { - // let external_type = self.external_type.as_str(); match external_type { "module-import" => { if let Some(external_type) = dependency_meta.external_type.as_ref() { diff --git a/crates/rspack_core/src/loader/loader_runner.rs b/crates/rspack_core/src/loader/loader_runner.rs index d9044c6b077..2eb8b1095d8 100644 --- a/crates/rspack_core/src/loader/loader_runner.rs +++ b/crates/rspack_core/src/loader/loader_runner.rs @@ -21,6 +21,7 @@ pub struct CompilerModuleContext { pub user_request: Option, pub raw_request: Option, pub factory_meta: Option, + pub use_source_map: bool, } impl CompilerModuleContext { @@ -40,6 +41,7 @@ impl CompilerModuleContext { factory_meta: normal_module .and_then(|normal_module| normal_module.factory_meta()) .map(|factory_meta| factory_meta.to_owned()), + use_source_map: module.get_source_map_kind().source_map(), } } } diff --git a/crates/rspack_core/src/options/filename.rs b/crates/rspack_core/src/options/filename.rs index 2da9cda6760..a7a3bdf3d2b 100644 --- a/crates/rspack_core/src/options/filename.rs +++ b/crates/rspack_core/src/options/filename.rs @@ -121,6 +121,7 @@ impl LocalFilenameFn for NoFilenameFn { &self, _path_data: &PathData, _asset_info: Option<&AssetInfo>, + _hash_digest_length: usize, ) -> Result { match self.0 {} } @@ -142,6 +143,7 @@ pub trait LocalFilenameFn { &self, path_data: &PathData, asset_info: Option<&AssetInfo>, + hash_digest_length: usize, ) -> Result; } @@ -154,13 +156,17 @@ impl LocalFilenameFn for Arc { &self, path_data: &PathData, asset_info: Option<&AssetInfo>, + hash_digest_length: usize, ) -> Result { - self.deref().call(path_data, asset_info).map_err(|err| { - error!( - "Failed to render filename function: {}. Did you return the correct filename?", - err.to_string() - ) - }) + self + .deref() + .call(path_data, asset_info, hash_digest_length) + .map_err(|err| { + error!( + "Failed to render filename function: {}. Did you return the correct filename?", + err.to_string() + ) + }) } } @@ -204,14 +210,20 @@ impl Filename { &self, options: PathData, asset_info: Option<&mut AssetInfo>, + hash_digest_length: usize, ) -> Result { let template = match &self.0 { FilenameKind::Template(template) => Cow::Borrowed(template.as_str()), FilenameKind::Fn(filename_fn) => { - Cow::Owned(filename_fn.call(&options, asset_info.as_deref())?) + Cow::Owned(filename_fn.call(&options, asset_info.as_deref(), hash_digest_length)?) } }; - Ok(render_template(template, options, asset_info)) + Ok(render_template( + template, + options, + asset_info, + hash_digest_length, + )) } } @@ -219,6 +231,7 @@ fn render_template( template: Cow, options: PathData, mut asset_info: Option<&mut AssetInfo>, + hash_digest_length: usize, ) -> String { let mut t = template; if let Some(filename) = options.filename { @@ -284,7 +297,14 @@ fn render_template( .map(|t| FRAGMENT_PLACEHOLDER.replace_all(t, NoExpand(&fragment.unwrap_or_default()))); } } - if let Some(content_hash) = options.content_hash { + if let Some(content_hash) = options.content_hash.or_else(|| { + let chunk = options.chunk?; + let content_hash_type = options.content_hash_type?; + chunk + .content_hash + .get(&content_hash_type) + .map(|h| h.rendered(hash_digest_length)) + }) { if let Some(asset_info) = asset_info.as_mut() { // set version as content hash asset_info.version = content_hash.to_string(); diff --git a/crates/rspack_core/src/options/module.rs b/crates/rspack_core/src/options/module.rs index af03bb71b28..9a9c5e3013e 100644 --- a/crates/rspack_core/src/options/module.rs +++ b/crates/rspack_core/src/options/module.rs @@ -235,6 +235,10 @@ pub struct JavascriptParserOptions { pub worker: Option>, pub override_strict: Option, pub import_meta: Option, + pub require_as_expression: Option, + pub require_dynamic: Option, + pub require_resolve: Option, + pub import_dynamic: Option, } #[derive(Debug, Clone, MergeFrom)] diff --git a/crates/rspack_core/src/options/output.rs b/crates/rspack_core/src/options/output.rs index 886530f77f5..d8531a3d014 100644 --- a/crates/rspack_core/src/options/output.rs +++ b/crates/rspack_core/src/options/output.rs @@ -11,7 +11,7 @@ use sugar_path::SugarPath; use crate::{ Chunk, ChunkGraph, ChunkGroupByUkey, ChunkKind, Compilation, Filename, FilenameTemplate, Module, - RuntimeSpec, + RuntimeSpec, SourceType, }; #[derive(Debug)] @@ -213,6 +213,7 @@ pub struct PathData<'a> { pub runtime: Option<&'a str>, pub url: Option<&'a str>, pub id: Option<&'a str>, + pub content_hash_type: Option, } static PREPARE_ID_REGEX: LazyLock = @@ -258,6 +259,11 @@ impl<'a> PathData<'a> { self } + pub fn content_hash_type(mut self, v: SourceType) -> Self { + self.content_hash_type = Some(v); + self + } + pub fn chunk_graph(mut self, v: &'a ChunkGraph) -> Self { self.chunk_graph = Some(v); self diff --git a/crates/rspack_hash/src/lib.rs b/crates/rspack_hash/src/lib.rs index 5552e71e763..fa6b9234eb6 100644 --- a/crates/rspack_hash/src/lib.rs +++ b/crates/rspack_hash/src/lib.rs @@ -126,6 +126,14 @@ pub struct RspackHashDigest { encoded: SmolStr, } +impl From<&str> for RspackHashDigest { + fn from(value: &str) -> Self { + Self { + encoded: value.into(), + } + } +} + impl RspackHashDigest { pub fn new(inner: Vec, digest: &HashDigest) -> Self { let encoded = match digest { diff --git a/crates/rspack_plugin_copy/src/lib.rs b/crates/rspack_plugin_copy/src/lib.rs index 26a5f4d53ee..a07446dcb53 100644 --- a/crates/rspack_plugin_copy/src/lib.rs +++ b/crates/rspack_plugin_copy/src/lib.rs @@ -423,7 +423,7 @@ impl CopyRspackPlugin { if dot_enable.is_none() { dot_enable = Some(true); } - let mut escaped = Utf8PathBuf::from(escape_glob_chars(abs_from.as_str())); + let mut escaped = Utf8PathBuf::from(GlobPattern::escape(abs_from.as_str())); escaped.push("**/*"); escaped.as_str().to_string() @@ -437,7 +437,7 @@ impl CopyRspackPlugin { dot_enable = Some(true); } - escape_glob_chars(abs_from.as_str()) + GlobPattern::escape(abs_from.as_str()) } FromType::Glob => { need_add_context_to_dependency = true; @@ -687,18 +687,6 @@ fn get_closest_common_parent_dir(paths: &[&Utf8Path]) -> Option { Some(parent_dir) } -fn escape_glob_chars(s: &str) -> String { - let mut escaped = String::with_capacity(s.len()); - for c in s.chars() { - match c { - '*' | '?' | '[' | ']' => escaped.push('\\'), - _ => {} - } - escaped.push(c); - } - escaped -} - fn set_info(target: &mut AssetInfo, info: Info) { if let Some(minimized) = info.minimized { target.minimized.replace(minimized); @@ -737,12 +725,6 @@ fn set_info(target: &mut AssetInfo, info: Info) { } } -#[test] -fn test_escape() { - assert_eq!(escape_glob_chars("a/b/**/*.js"), r#"a/b/\*\*/\*.js"#); - assert_eq!(escape_glob_chars("a/b/c"), r#"a/b/c"#); -} - // If this test fails, you should modify `set_info` function, according to your changes about AssetInfo // Make sure every field of AssetInfo is considered #[test] diff --git a/crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs b/crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs index 43a56bf6a5b..980e6d342b5 100644 --- a/crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs +++ b/crates/rspack_plugin_css/src/plugin/impl_plugin_for_css_plugin.rs @@ -333,12 +333,7 @@ async fn render_manifest( filename_template, PathData::default() .chunk(chunk) - .content_hash_optional( - chunk - .content_hash - .get(&SourceType::Css) - .map(|i| i.rendered(compilation.options.output.hash_digest_length)), - ) + .content_hash_type(SourceType::Css) .runtime(&chunk.runtime), )?; asset_info.set_css_unused_idents(unused_idents); diff --git a/crates/rspack_plugin_css/src/utils.rs b/crates/rspack_plugin_css/src/utils.rs index da5bfe22130..b6826df3d50 100644 --- a/crates/rspack_plugin_css/src/utils.rs +++ b/crates/rspack_plugin_css/src/utils.rs @@ -90,7 +90,7 @@ impl<'a> LocalIdentOptions<'a> { local, unique_name: &output.unique_name, } - .render_local_ident_name(self.local_name_ident) + .render_local_ident_name(self.local_name_ident, output.hash_digest_length) } } @@ -101,10 +101,14 @@ struct LocalIdentNameRenderOptions<'a> { } impl LocalIdentNameRenderOptions<'_> { - pub fn render_local_ident_name(self, local_ident_name: &LocalIdentName) -> String { + pub fn render_local_ident_name( + self, + local_ident_name: &LocalIdentName, + hash_digest_length: usize, + ) -> String { let raw = local_ident_name .template - .render(self.path_data, None) + .render(self.path_data, None, hash_digest_length) .always_ok(); let s: &str = raw.as_ref(); diff --git a/crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs b/crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs index 1ca5fd76ce8..ffee6e3de68 100644 --- a/crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs +++ b/crates/rspack_plugin_devtool/src/source_map_dev_tool_plugin.rs @@ -423,7 +423,7 @@ impl SourceMapDevToolPlugin { SourceMappingUrlCommentRef::Fn(f) => { let comment = futures::executor::block_on(f(data))?; FilenameTemplate::from(comment) - .render(data, None) + .render(data, None, output_options.hash_digest_length) .always_ok() } }; diff --git a/crates/rspack_plugin_extract_css/src/plugin.rs b/crates/rspack_plugin_extract_css/src/plugin.rs index fe126ed6f99..2196414f14e 100644 --- a/crates/rspack_plugin_extract_css/src/plugin.rs +++ b/crates/rspack_plugin_extract_css/src/plugin.rs @@ -591,12 +591,9 @@ async fn render_manifest( rendered_modules, filename_template, compilation, - PathData::default().chunk(chunk).content_hash_optional( - chunk - .content_hash - .get(&SOURCE_TYPE[0]) - .map(|hash| hash.encoded()), - ), + PathData::default() + .chunk(chunk) + .content_hash_type(SOURCE_TYPE[0]), ) .await?; diff --git a/crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs b/crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs index 249e6b5b644..deddd34b60a 100644 --- a/crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs +++ b/crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs @@ -91,6 +91,10 @@ pub struct CommonJsImportsParserPlugin; impl CommonJsImportsParserPlugin { fn process_resolve(&self, parser: &mut JavascriptParser, call_expr: &CallExpr, weak: bool) { + if matches!(parser.javascript_options.require_resolve, Some(false)) { + return; + } + if call_expr.args.len() != 1 { return; } @@ -268,6 +272,10 @@ impl CommonJsImportsParserPlugin { } } + if matches!(parser.javascript_options.require_dynamic, Some(false)) && !param.is_string() { + return None; + } + // FIXME: should support `LocalModuleDependency` if self .process_require_item(parser, call_expr.span, ¶m) @@ -290,6 +298,10 @@ impl CommonJsImportsParserPlugin { parser: &mut JavascriptParser, ident: &Ident, ) -> Option { + if parser.javascript_options.require_as_expression == Some(false) { + return None; + } + let start = ident.span().real_lo(); let end = ident.span().real_hi(); let mut dep = CommonJsRequireContextDependency::new( diff --git a/crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs b/crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs index cf08407983b..58f49a5e5b2 100644 --- a/crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs +++ b/crates/rspack_plugin_javascript/src/parser_plugin/import_parser_plugin.rs @@ -146,6 +146,10 @@ impl JavascriptParserPlugin for ImportParserPlugin { parser.blocks.push(Box::new(block)); Some(true) } else { + if matches!(parser.javascript_options.import_dynamic, Some(false)) { + return None; + } + let ContextModuleScanResult { context, reg, diff --git a/crates/rspack_plugin_javascript/src/plugin/impl_plugin_for_js_plugin.rs b/crates/rspack_plugin_javascript/src/plugin/impl_plugin_for_js_plugin.rs index ee3adb73999..7224f34dd28 100644 --- a/crates/rspack_plugin_javascript/src/plugin/impl_plugin_for_js_plugin.rs +++ b/crates/rspack_plugin_javascript/src/plugin/impl_plugin_for_js_plugin.rs @@ -255,12 +255,7 @@ async fn render_manifest( filename_template, PathData::default() .chunk(chunk) - .content_hash_optional( - chunk - .content_hash - .get(&SourceType::JavaScript) - .map(|i| i.rendered(compilation.options.output.hash_digest_length)), - ) + .content_hash_type(SourceType::JavaScript) .runtime(&chunk.runtime), )?; asset_info.set_javascript_module(compilation.options.output.module); diff --git a/crates/rspack_plugin_library/src/amd_library_plugin.rs b/crates/rspack_plugin_library/src/amd_library_plugin.rs index e3df31acce9..a606fd9f683 100644 --- a/crates/rspack_plugin_library/src/amd_library_plugin.rs +++ b/crates/rspack_plugin_library/src/amd_library_plugin.rs @@ -132,12 +132,9 @@ fn render( let normalize_name = compilation .get_path( &FilenameTemplate::from(name.to_string()), - PathData::default().chunk(chunk).content_hash_optional( - chunk - .content_hash - .get(&SourceType::JavaScript) - .map(|i| i.rendered(compilation.options.output.hash_digest_length)), - ), + PathData::default() + .chunk(chunk) + .content_hash_type(SourceType::JavaScript), ) .always_ok(); source.add(RawSource::from(format!( diff --git a/crates/rspack_plugin_library/src/assign_library_plugin.rs b/crates/rspack_plugin_library/src/assign_library_plugin.rs index 18e1656bfa4..ec60ae7dee0 100644 --- a/crates/rspack_plugin_library/src/assign_library_plugin.rs +++ b/crates/rspack_plugin_library/src/assign_library_plugin.rs @@ -156,12 +156,9 @@ impl AssignLibraryPlugin { compilation .get_path( &FilenameTemplate::from(v.to_owned()), - PathData::default().chunk(chunk).content_hash_optional( - chunk - .content_hash - .get(&SourceType::JavaScript) - .map(|i| i.rendered(compilation.options.output.hash_digest_length)), - ), + PathData::default() + .chunk(chunk) + .content_hash_type(SourceType::JavaScript), ) .always_ok() }; diff --git a/crates/rspack_plugin_library/src/umd_library_plugin.rs b/crates/rspack_plugin_library/src/umd_library_plugin.rs index 40cbddc3977..0f2f714440a 100644 --- a/crates/rspack_plugin_library/src/umd_library_plugin.rs +++ b/crates/rspack_plugin_library/src/umd_library_plugin.rs @@ -305,12 +305,9 @@ fn replace_keys(v: String, chunk: &Chunk, compilation: &Compilation) -> String { compilation .get_path( &FilenameTemplate::from(v), - PathData::default().chunk(chunk).content_hash_optional( - chunk - .content_hash - .get(&SourceType::JavaScript) - .map(|i| i.rendered(compilation.options.output.hash_digest_length)), - ), + PathData::default() + .chunk(chunk) + .content_hash_type(SourceType::JavaScript), ) .always_ok() } diff --git a/crates/rspack_plugin_runtime/src/helpers.rs b/crates/rspack_plugin_runtime/src/helpers.rs index c221d5b9016..60f00fcf453 100644 --- a/crates/rspack_plugin_runtime/src/helpers.rs +++ b/crates/rspack_plugin_runtime/src/helpers.rs @@ -5,6 +5,7 @@ use rspack_core::{ get_chunk_from_ukey, get_chunk_group_from_ukey, get_js_chunk_filename_template, rspack_sources::{BoxSource, RawSource, SourceExt}, Chunk, ChunkGroupByUkey, ChunkGroupUkey, ChunkUkey, Compilation, PathData, RuntimeGlobals, + SourceType, }; use rspack_error::{error, Result}; use rspack_hash::RspackHash; @@ -255,7 +256,8 @@ pub fn get_chunk_output_name(chunk: &Chunk, compilation: &Compilation) -> Result filename, PathData::default() .chunk(chunk) - .content_hash_optional(hash) + .hash_optional(hash) + .content_hash_type(SourceType::JavaScript) .hash_optional(hash), ) } diff --git a/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs b/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs index 74c94bc2d99..24d52965397 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/auto_public_path.rs @@ -44,12 +44,9 @@ impl RuntimeModule for AutoPublicPathRuntimeModule { ); let filename = compilation.get_path( filename, - PathData::default().chunk(chunk).content_hash_optional( - chunk - .content_hash - .get(&SourceType::JavaScript) - .map(|i| i.rendered(compilation.options.output.hash_digest_length)), - ), + PathData::default() + .chunk(chunk) + .content_hash_type(SourceType::JavaScript), )?; Ok( RawSource::from(auto_public_path_template( diff --git a/crates/rspack_plugin_runtime/src/runtime_module/get_chunk_filename.rs b/crates/rspack_plugin_runtime/src/runtime_module/get_chunk_filename.rs index 67961116733..65c659ab01a 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/get_chunk_filename.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/get_chunk_filename.rs @@ -234,7 +234,7 @@ impl RuntimeModule for GetChunkFilenameRuntimeModule { PathData::default() .chunk(&fake_chunk) .hash_optional(Some(full_hash.as_str())) - .content_hash_optional(content_hash.as_deref()), + .content_hash_optional(content_hash.as_deref()) ) .always_ok() ) @@ -305,6 +305,7 @@ impl RuntimeModule for GetChunkFilenameRuntimeModule { .chunk(&fake_chunk) .hash_optional(Some(full_hash.as_str())) .content_hash_optional(content_hash.as_deref()) + .content_hash_type(self.source_type), )?, ); diff --git a/crates/rspack_plugin_runtime/src/runtime_module/utils.rs b/crates/rspack_plugin_runtime/src/runtime_module/utils.rs index ea27788dc31..8141ee4f5b3 100644 --- a/crates/rspack_plugin_runtime/src/runtime_module/utils.rs +++ b/crates/rspack_plugin_runtime/src/runtime_module/utils.rs @@ -129,12 +129,9 @@ pub fn get_output_dir( ); let output_dir = compilation.get_path( filename, - PathData::default().chunk(chunk).content_hash_optional( - chunk - .content_hash - .get(&SourceType::JavaScript) - .map(|i| i.rendered(compilation.options.output.hash_digest_length)), - ), + PathData::default() + .chunk(chunk) + .content_hash_type(SourceType::JavaScript), )?; Ok(get_undo_path( output_dir.as_str(), diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json index 105d31cf01d..2e0b7bf3e8a 100644 --- a/npm/darwin-arm64/package.json +++ b/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/binding-darwin-arm64", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "Node binding for rspack", "main": "rspack.darwin-arm64.node", diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json index f5f76a33d0a..270d83e8d7f 100644 --- a/npm/darwin-x64/package.json +++ b/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/binding-darwin-x64", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "Node binding for rspack", "main": "rspack.darwin-x64.node", diff --git a/npm/linux-x64-gnu/package.json b/npm/linux-x64-gnu/package.json index 9d990cb15a5..ee857467755 100644 --- a/npm/linux-x64-gnu/package.json +++ b/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/binding-linux-x64-gnu", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "Node binding for rspack", "main": "rspack.linux-x64-gnu.node", diff --git a/npm/win32-x64-msvc/package.json b/npm/win32-x64-msvc/package.json index c383e27e1f8..c2d9ed63bc2 100644 --- a/npm/win32-x64-msvc/package.json +++ b/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/binding-win32-x64-msvc", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "Node binding for rspack", "main": "rspack.win32-x64-msvc.node", diff --git a/package.json b/package.json index a2c58f6ebb9..5f2f2a033dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monorepo", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "The fast Rust-based web bundler with webpack-compatible API", "private": true, diff --git a/packages/create-rspack/package.json b/packages/create-rspack/package.json index 650cba5c335..f13d6a95fdb 100644 --- a/packages/create-rspack/package.json +++ b/packages/create-rspack/package.json @@ -1,6 +1,6 @@ { "name": "create-rspack", - "version": "1.0.8", + "version": "1.0.9", "homepage": "https://rspack.dev", "bugs": "https://github.com/web-infra-dev/rspack/issues", "repository": { diff --git a/packages/rspack-cli/package.json b/packages/rspack-cli/package.json index c6f75725e55..d5e5539bc60 100644 --- a/packages/rspack-cli/package.json +++ b/packages/rspack-cli/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/cli", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "CLI for rspack", "publishConfig": { diff --git a/packages/rspack-test-tools/package.json b/packages/rspack-test-tools/package.json index d23db297122..98d2adbea3b 100644 --- a/packages/rspack-test-tools/package.json +++ b/packages/rspack-test-tools/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/test-tools", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "description": "Test tools for rspack", "main": "dist/index.js", 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 20b588cac54..4efaad11249 100644 --- a/packages/rspack-test-tools/tests/__snapshots__/Defaults.test.js.snap +++ b/packages/rspack-test-tools/tests/__snapshots__/Defaults.test.js.snap @@ -170,7 +170,11 @@ Object { "dynamicImportPrefetch": false, "dynamicImportPreload": false, "exprContextCritical": true, + "importDynamic": true, "importMeta": true, + "requireAsExpression": true, + "requireDynamic": true, + "requireResolve": true, "strictExportPresence": false, "url": true, "worker": Array [ diff --git a/packages/rspack-test-tools/tests/configCases/hooks/get-path-custom-chunk/rspack.config.js b/packages/rspack-test-tools/tests/configCases/hooks/get-path-custom-chunk/rspack.config.js index 1184a56adb4..e564d0423dc 100644 --- a/packages/rspack-test-tools/tests/configCases/hooks/get-path-custom-chunk/rspack.config.js +++ b/packages/rspack-test-tools/tests/configCases/hooks/get-path-custom-chunk/rspack.config.js @@ -5,13 +5,17 @@ class Plugin { let called = false; compiler.hooks.compilation.tap(pluginName, compilation => { called = true; - expect(compilation.getPath("[id]-[name]-[chunkhash]", { + expect(compilation.getPath("[id]-[name]-[chunkhash]-[contenthash]", { chunk: { name: "chunkname", id: "chunkid", hash: "chunkhash", - } - })).toBe("chunkid-chunkname-chunkhash"); + contentHash: { + javascript: "contenthash" + } + }, + contentHashType: "javascript" + })).toBe("chunkid-chunkname-chunkhash-contenthash"); }); compiler.hooks.done.tap(pluginName, stats => { let json = stats.toJson(); diff --git a/packages/rspack-test-tools/tests/configCases/hooks/get-path-existing-chunk/rspack.config.js b/packages/rspack-test-tools/tests/configCases/hooks/get-path-existing-chunk/rspack.config.js index 0a03bc428ba..180315ae853 100644 --- a/packages/rspack-test-tools/tests/configCases/hooks/get-path-existing-chunk/rspack.config.js +++ b/packages/rspack-test-tools/tests/configCases/hooks/get-path-existing-chunk/rspack.config.js @@ -7,9 +7,10 @@ class Plugin { compilation.hooks.processAssets.tap(pluginName, () => { called = true; const mainChunk = Array.from(compilation.chunks).find(chunk => chunk.name === "main"); - expect(compilation.getPath("[id]-[name]-[chunkhash]", { - chunk: mainChunk - })).toBe(`${mainChunk.id}-${mainChunk.name}-${mainChunk.renderedHash}`); + expect(compilation.getPath("[id]-[name]-[chunkhash]-[contenthash]", { + chunk: mainChunk, + contentHashType: "javascript", + })).toBe(`${mainChunk.id}-${mainChunk.name}-${mainChunk.renderedHash}-${mainChunk.contentHash["javascript"].slice(0, 20)}`); }); }); compiler.hooks.done.tap(pluginName, stats => { diff --git a/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/index.js b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/index.js new file mode 100644 index 00000000000..5ccfe87311a --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/index.js @@ -0,0 +1,8 @@ +const dir = process.env.name + +import('./other.js') + +import('./' + dir + '/other.js') +import(dir) + + diff --git a/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/other.js b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/other.js new file mode 100644 index 00000000000..a40bd61c9ec --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/other.js @@ -0,0 +1 @@ +module.exports = 'other'; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/rspack.config.js b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/rspack.config.js new file mode 100644 index 00000000000..282a7f6bde1 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/rspack.config.js @@ -0,0 +1,22 @@ +// TODO: move to webpack-test after merged into webpack + +/** @type {import("../../../../types").Configuration} */ +module.exports = { + entry: { + bundle0: "./index.js", + test: "./test.js" + }, + module: { + parser: { + javascript: { + importDynamic: false + } + } + }, + output: { + filename: "[name].js" + }, + node: { + __dirname: false + } +}; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/test.config.js b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/test.config.js new file mode 100644 index 00000000000..f6c7ebc1a35 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/test.config.js @@ -0,0 +1,6 @@ +module.exports = { + findBundle: function (i, options) { + return ["test.js"]; + } +}; + diff --git a/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/test.js b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/test.js new file mode 100644 index 00000000000..fb72b117b44 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/import-dynamic/test.js @@ -0,0 +1,9 @@ +const fs = require("fs"); +const path = require("path"); + +it("import() a dynamical expression should preserve as-is when `importDynamic` is disabled", () => { + const code = fs.readFileSync(path.join(__dirname, "./bundle0.js"), 'utf-8'); + expect(code).not.toContain("import('./other.js')"); + expect(code).toContain("import('./' + dir + '/other.js')"); + expect(code).toContain("import(dir)"); +}); diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/index.js b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/index.js new file mode 100644 index 00000000000..9ddd60e6902 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/index.js @@ -0,0 +1,9 @@ +require('./other.js') + +const resolve1 = require.resolve +resolve1('./other.js') + +const lazyFn = (module, requireFn) => {} +lazyFn('./other.js', require) + + diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/other.js b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/other.js new file mode 100644 index 00000000000..a40bd61c9ec --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/other.js @@ -0,0 +1 @@ +module.exports = 'other'; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/rspack.config.js b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/rspack.config.js new file mode 100644 index 00000000000..dfec88066ef --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/rspack.config.js @@ -0,0 +1,20 @@ +/** @type {import("../../../../types").Configuration} */ +module.exports = { + entry: { + bundle0: "./index.js", + test: "./test.js" + }, + module: { + parser: { + javascript: { + requireAsExpression: false + } + } + }, + output: { + filename: "[name].js" + }, + node: { + __dirname: false + } +}; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/test.config.js b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/test.config.js new file mode 100644 index 00000000000..462b2ee4d92 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/test.config.js @@ -0,0 +1,7 @@ +// TODO: move to webpack-test after merged into webpack + +module.exports = { + findBundle: function (i, options) { + return ["test.js"]; + } +}; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/test.js b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/test.js new file mode 100644 index 00000000000..f3199958459 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-as-expression/test.js @@ -0,0 +1,9 @@ +const fs = require("fs"); +const path = require("path"); + +it("use require as a expression should preserve as-is when `requireAsExpression` is disabled", () => { + const code = fs.readFileSync(path.join(__dirname, "./bundle0.js"), 'utf-8'); + expect(code).not.toContain("require('./other.js')"); + expect(code).toContain("resolve1('./other.js')"); + expect(code).toContain(`lazyFn('./other.js', require)`); +}); diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/index.js b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/index.js new file mode 100644 index 00000000000..ae676307c86 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/index.js @@ -0,0 +1,11 @@ +const dir = process.env.name + +const require1 = require(dir) + +const require2 = require('./other.js') + +const require3 = require('./foo/' + dir + '.js') + +const require4 = require(a + './foo/' + dir + '.js') + +const require5 = require(dir ? './foo/' + dir + '.js' : './foo/nested' + dir + 'js') diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/other.js b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/other.js new file mode 100644 index 00000000000..a40bd61c9ec --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/other.js @@ -0,0 +1 @@ +module.exports = 'other'; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/rspack.config.js b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/rspack.config.js new file mode 100644 index 00000000000..7a90bbc4bbb --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/rspack.config.js @@ -0,0 +1,24 @@ +// TODO: move to webpack-test after merged into webpack + +/** @type {import("../../../../types").Configuration} */ +module.exports = { + entry: { + bundle0: "./index.js", + test: "./test.js" + }, + module: { + parser: { + javascript: { + requireDynamic: false, + // To preserve `require(...)`, we need to use `requireAsExpression: false` alongside. + requireAsExpression: false + } + } + }, + output: { + filename: "[name].js" + }, + node: { + __dirname: false + } +}; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/test.config.js b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/test.config.js new file mode 100644 index 00000000000..ac02270e090 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/test.config.js @@ -0,0 +1,5 @@ +module.exports = { + findBundle: function (i, options) { + return ["test.js"]; + } +}; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/test.js b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/test.js new file mode 100644 index 00000000000..6b48e01a3ab --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-dynamic/test.js @@ -0,0 +1,11 @@ +const fs = require("fs"); +const path = require("path"); + +it("require a dynamical expression should preserve as-is when `requireDynamic` is disabled", () => { + const code = fs.readFileSync(path.join(__dirname, "./bundle0.js"), 'utf-8'); + expect(code).toContain("require(dir)"); + expect(code).not.toContain("require('./other.js')"); + expect(code).toContain("require('./foo/' + dir + '.js')"); + expect(code).toContain("require(a + './foo/' + dir + '.js')"); + expect(code).toContain("require(dir ? './foo/' + dir + '.js' : './foo/nested' + dir + 'js')"); +}); diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/index.js b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/index.js new file mode 100644 index 00000000000..33a68c36daf --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/index.js @@ -0,0 +1,19 @@ +const dir = process.env.DIR_READ_FROM_RUNTIME + +const resolve1 = require.resolve(dir) + +const resolve2 = require.resolve('./other.js') + +const resolve3 = require.resolve('./foo/' + dir + '.js') + +const resolve4 = require.resolve(process.env.RANDOM ? './foo/' + dir + '.js' : './bar/' + dir + 'js') + + +// Can't handle, `require` will turn into expression +// const resolve5 = require.resolve +// resolve5('./other.js') + +// Can't handle, `require` will turn into `undefined` +// const __require = require +// const resolve6 = __require.resolve('./other.js') + diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/rspack.config.js b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/rspack.config.js new file mode 100644 index 00000000000..fc873b694c9 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/rspack.config.js @@ -0,0 +1,25 @@ +// TODO: move to webpack-test after merged into webpack + +/** @type {import("../../../../types").Configuration} */ +module.exports = { + entry: { + bundle0: "./index.js", + test: "./test.js" + }, + module: { + parser: { + javascript: { + requireResolve: false, + // To preserve `require.resolve`, we need to use `requireResolve: false` to preserve + // the `resolve` method and `requireAsExpression: false` to preserve `require`. + requireAsExpression: false + } + } + }, + output: { + filename: "[name].js" + }, + node: { + __dirname: false + } +}; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/test.config.js b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/test.config.js new file mode 100644 index 00000000000..ac02270e090 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/test.config.js @@ -0,0 +1,5 @@ +module.exports = { + findBundle: function (i, options) { + return ["test.js"]; + } +}; diff --git a/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/test.js b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/test.js new file mode 100644 index 00000000000..dc2121158a8 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/parsing/require-resolve/test.js @@ -0,0 +1,10 @@ +const fs = require("fs"); +const path = require("path"); + +it("`require.resolve` should preserve as-is when `requireResolve` is disabled", () => { + const code = fs.readFileSync(path.join(__dirname, "./bundle0.js"), 'utf-8'); + expect(code).toContain("require.resolve(dir)"); + expect(code).toContain("require.resolve('./other.js')"); + expect(code).toContain("require.resolve('./foo/' + dir + '.js')"); + expect(code).toContain("require.resolve(process.env.RANDOM ? './foo/' + dir + '.js' : './bar/' + dir + 'js')"); +}); diff --git a/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/index.js b/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/index.js new file mode 100644 index 00000000000..86d08db9cad --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/index.js @@ -0,0 +1,3 @@ +it("should include a.ts in SourceMap", function() { + expect(__SOURCEMAP__).toBe(true); +}); diff --git a/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/loader.js b/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/loader.js new file mode 100644 index 00000000000..6bd25aec203 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/loader.js @@ -0,0 +1,3 @@ +module.exports = function (content) { + return content.replace("__SOURCEMAP__", this.sourceMap); +}; diff --git a/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/rspack.config.js b/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/rspack.config.js new file mode 100644 index 00000000000..8634d736cc8 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/source-map/custom-loader/rspack.config.js @@ -0,0 +1,16 @@ +/** @type {import("@rspack/core").Configuration} */ +module.exports = { + devtool: false, + plugins: [ + compiler => { + new compiler.webpack.SourceMapDevToolPlugin({}).apply(compiler); + } + ], + module: { + rules: [ + { + loader: "./loader.js" + } + ] + } +}; diff --git a/packages/rspack/etc/api.md b/packages/rspack/etc/api.md index c933341dde7..8ee6d900b17 100644 --- a/packages/rspack/etc/api.md +++ b/packages/rspack/etc/api.md @@ -524,10 +524,8 @@ const baseRuleSetRule: z.ZodObject<{ resource?: RuleSetCondition | undefined; layer?: string | undefined; options?: string | Record | undefined; - test?: RuleSetCondition | undefined; - enforce?: "pre" | "post" | undefined; - sideEffects?: boolean | undefined; loader?: string | undefined; + test?: RuleSetCondition | undefined; exclude?: RuleSetCondition | undefined; include?: RuleSetCondition | undefined; issuer?: RuleSetCondition | undefined; @@ -555,15 +553,15 @@ const baseRuleSetRule: z.ZodObject<{ parser?: Record | undefined; generator?: Record | undefined; resolve?: t.ResolveOptions | undefined; + sideEffects?: boolean | undefined; + enforce?: "pre" | "post" | undefined; }, { type?: string | undefined; resource?: RuleSetCondition | undefined; layer?: string | undefined; options?: string | Record | undefined; - test?: RuleSetCondition | undefined; - enforce?: "pre" | "post" | undefined; - sideEffects?: boolean | undefined; loader?: string | undefined; + test?: RuleSetCondition | undefined; exclude?: RuleSetCondition | undefined; include?: RuleSetCondition | undefined; issuer?: RuleSetCondition | undefined; @@ -591,6 +589,8 @@ const baseRuleSetRule: z.ZodObject<{ parser?: Record | undefined; generator?: Record | undefined; resolve?: t.ResolveOptions | undefined; + sideEffects?: boolean | undefined; + enforce?: "pre" | "post" | undefined; }>; // @public @@ -3505,6 +3505,10 @@ const javascriptParserOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -3520,6 +3524,10 @@ const javascriptParserOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -3535,6 +3543,10 @@ const javascriptParserOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>; // @public (undocumented) @@ -4694,6 +4706,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4709,6 +4725,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4724,6 +4744,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/auto": z.ZodOptional>; @@ -4740,6 +4764,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4755,6 +4783,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4770,6 +4802,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/dynamic": z.ZodOptional>; @@ -4786,6 +4822,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4801,6 +4841,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4816,6 +4860,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/esm": z.ZodOptional>; @@ -4832,6 +4880,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4847,6 +4899,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -4862,6 +4918,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; }, "strict", z.ZodTypeAny, { javascript?: { @@ -4879,6 +4939,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -4909,6 +4973,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -4925,6 +4993,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -4941,6 +5013,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }, { javascript?: { @@ -4958,6 +5034,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -4988,6 +5068,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -5004,6 +5088,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -5020,6 +5108,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }>, z.ZodRecord>]>>; generator: z.ZodOptional> | undefined; generator?: Record> | { @@ -5395,6 +5503,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -5425,6 +5537,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -5441,6 +5557,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -5457,6 +5577,10 @@ const moduleOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; } | Record> | undefined; generator?: Record> | { @@ -5793,382 +5917,33 @@ type ObjectEncodingOptions = { }; // @public (undocumented) -export type Optimization = z.infer; - -// @public (undocumented) -const optimization: z.ZodObject<{ - moduleIds: z.ZodOptional>; - chunkIds: z.ZodOptional>; - minimize: z.ZodOptional; - minimizer: z.ZodOptional, z.ZodUnion<[z.ZodType, z.ZodUnion<[z.ZodLiteral, z.ZodLiteral<0>, z.ZodLiteral<"">, z.ZodNull, z.ZodUndefined]>]>]>, "many">>; - mergeDuplicateChunks: z.ZodOptional; - splitChunks: z.ZodOptional, z.ZodObject<{ - chunks: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; - defaultSizeTypes: z.ZodOptional>; - minChunks: z.ZodOptional; - usedExports: z.ZodOptional; - name: z.ZodOptional]>, z.ZodFunction>], z.ZodUnknown>, z.ZodUnknown>]>>; - minSize: z.ZodOptional]>>; - maxSize: z.ZodOptional]>>; - maxAsyncSize: z.ZodOptional]>>; - maxInitialSize: z.ZodOptional]>>; - maxAsyncRequests: z.ZodOptional; - maxInitialRequests: z.ZodOptional; - automaticNameDelimiter: z.ZodOptional; - cacheGroups: z.ZodOptional, z.ZodObject<{ - chunks: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; - defaultSizeTypes: z.ZodOptional>; - minChunks: z.ZodOptional; - usedExports: z.ZodOptional; - name: z.ZodOptional]>, z.ZodFunction>], z.ZodUnknown>, z.ZodUnknown>]>>; - minSize: z.ZodOptional]>>; - maxSize: z.ZodOptional]>>; - maxAsyncSize: z.ZodOptional]>>; - maxInitialSize: z.ZodOptional]>>; - maxAsyncRequests: z.ZodOptional; - maxInitialRequests: z.ZodOptional; - automaticNameDelimiter: z.ZodOptional; - test: z.ZodOptional]>, z.ZodFunction], z.ZodUnknown>, z.ZodUnknown>]>>; - priority: z.ZodOptional; - enforce: z.ZodOptional; - filename: z.ZodOptional; - reuseExistingChunk: z.ZodOptional; - type: z.ZodOptional]>>; - idHint: z.ZodOptional; - }, "strict", z.ZodTypeAny, { - type?: string | RegExp | undefined; - filename?: string | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }, { - type?: string | RegExp | undefined; - filename?: string | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }>]>>>; - fallbackCacheGroup: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; - minSize: z.ZodOptional; - maxSize: z.ZodOptional; - maxAsyncSize: z.ZodOptional; - maxInitialSize: z.ZodOptional; - automaticNameDelimiter: z.ZodOptional; - }, "strict", z.ZodTypeAny, { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - }, { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - }>>; - hidePathInfo: z.ZodOptional; - }, "strict", z.ZodTypeAny, { - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - cacheGroups?: Record unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }> | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - hidePathInfo?: boolean | undefined; - }, { - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - cacheGroups?: Record unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }> | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - hidePathInfo?: boolean | undefined; - }>]>>; - runtimeChunk: z.ZodOptional, z.ZodBoolean]>, z.ZodObject<{ - name: z.ZodOptional], z.ZodUnknown>, z.ZodString>]>>; - }, "strict", z.ZodTypeAny, { - name?: string | ((args_0: { - name: string; - }, ...args_1: unknown[]) => string) | undefined; - }, { - name?: string | ((args_0: { - name: string; - }, ...args_1: unknown[]) => string) | undefined; - }>]>>; - removeAvailableModules: z.ZodOptional; - removeEmptyChunks: z.ZodOptional; - realContentHash: z.ZodOptional; - sideEffects: z.ZodOptional, z.ZodBoolean]>>; - providedExports: z.ZodOptional; - concatenateModules: z.ZodOptional; - innerGraph: z.ZodOptional; - usedExports: z.ZodOptional, z.ZodBoolean]>>; - mangleExports: z.ZodOptional, z.ZodBoolean]>>; - nodeEnv: z.ZodOptional]>>; - emitOnErrors: z.ZodOptional; -}, "strict", z.ZodTypeAny, { - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - usedExports?: boolean | "global" | undefined; - splitChunks?: false | { - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - cacheGroups?: Record unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }> | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - hidePathInfo?: boolean | undefined; - } | undefined; - runtimeChunk?: boolean | "single" | "multiple" | { - name?: string | ((args_0: { - name: string; - }, ...args_1: unknown[]) => string) | undefined; - } | undefined; - removeAvailableModules?: boolean | undefined; - removeEmptyChunks?: boolean | undefined; - realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - providedExports?: boolean | undefined; - concatenateModules?: boolean | undefined; - innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; - nodeEnv?: string | false | undefined; - emitOnErrors?: boolean | undefined; -}, { - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - usedExports?: boolean | "global" | undefined; - splitChunks?: false | { - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - cacheGroups?: Record unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }> | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - hidePathInfo?: boolean | undefined; - } | undefined; - runtimeChunk?: boolean | "single" | "multiple" | { - name?: string | ((args_0: { - name: string; - }, ...args_1: unknown[]) => string) | undefined; - } | undefined; - removeAvailableModules?: boolean | undefined; - removeEmptyChunks?: boolean | undefined; - realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - providedExports?: boolean | undefined; - concatenateModules?: boolean | undefined; - innerGraph?: boolean | undefined; - mangleExports?: boolean | "size" | "deterministic" | undefined; - nodeEnv?: string | false | undefined; - emitOnErrors?: boolean | undefined; -}>; - -// @public (undocumented) -export type OptimizationRuntimeChunk = z.infer; +export type Optimization = { + moduleIds?: "named" | "natural" | "deterministic"; + chunkIds?: "natural" | "named" | "deterministic"; + minimize?: boolean; + minimizer?: Array<"..." | Plugin_2>; + mergeDuplicateChunks?: boolean; + splitChunks?: false | OptimizationSplitChunksOptions; + runtimeChunk?: OptimizationRuntimeChunk; + removeAvailableModules?: boolean; + removeEmptyChunks?: boolean; + realContentHash?: boolean; + sideEffects?: "flag" | boolean; + providedExports?: boolean; + concatenateModules?: boolean; + innerGraph?: boolean; + usedExports?: "global" | boolean; + mangleExports?: "size" | "deterministic" | boolean; + nodeEnv?: string | false; + emitOnErrors?: boolean; +}; -// @public (undocumented) -const optimizationRuntimeChunk: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["single", "multiple"]>, z.ZodBoolean]>, z.ZodObject<{ - name: z.ZodOptional], z.ZodUnknown>, z.ZodString>]>>; -}, "strict", z.ZodTypeAny, { - name?: string | ((args_0: { - name: string; - }, ...args_1: unknown[]) => string) | undefined; -}, { - name?: string | ((args_0: { +// @public +export type OptimizationRuntimeChunk = boolean | "single" | "multiple" | { + name?: string | ((value: { name: string; - }, ...args_1: unknown[]) => string) | undefined; -}>]>; + }) => string); +}; // @public (undocumented) export type OptimizationRuntimeChunkNormalized = false | { @@ -6177,266 +5952,42 @@ export type OptimizationRuntimeChunkNormalized = false | { }) => string); }; -// @public (undocumented) -export type OptimizationSplitChunksCacheGroup = z.infer; +// @public +export type OptimizationSplitChunksCacheGroup = { + test?: string | RegExp | ((module: Module) => unknown); + priority?: number; + enforce?: boolean; + filename?: string; + reuseExistingChunk?: boolean; + type?: string | RegExp; + idHint?: string; +} & SharedOptimizationSplitChunksCacheGroup; // @public (undocumented) -const optimizationSplitChunksCacheGroup: z.ZodObject<{ - chunks: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; - defaultSizeTypes: z.ZodOptional>; - minChunks: z.ZodOptional; - usedExports: z.ZodOptional; - name: z.ZodOptional]>, z.ZodFunction>], z.ZodUnknown>, z.ZodUnknown>]>>; - minSize: z.ZodOptional]>>; - maxSize: z.ZodOptional]>>; - maxAsyncSize: z.ZodOptional]>>; - maxInitialSize: z.ZodOptional]>>; - maxAsyncRequests: z.ZodOptional; - maxInitialRequests: z.ZodOptional; - automaticNameDelimiter: z.ZodOptional; - test: z.ZodOptional]>, z.ZodFunction], z.ZodUnknown>, z.ZodUnknown>]>>; - priority: z.ZodOptional; - enforce: z.ZodOptional; - filename: z.ZodOptional; - reuseExistingChunk: z.ZodOptional; - type: z.ZodOptional]>>; - idHint: z.ZodOptional; -}, "strict", z.ZodTypeAny, { - type?: string | RegExp | undefined; - filename?: string | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; -}, { - type?: string | RegExp | undefined; - filename?: string | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; -}>; +type OptimizationSplitChunksChunks = "initial" | "async" | "all" | RegExp | ((chunk: Chunk) => boolean); // @public (undocumented) -export type OptimizationSplitChunksNameFunction = z.infer; +type OptimizationSplitChunksName = string | false | OptimizationSplitChunksNameFunction; // @public (undocumented) -const optimizationSplitChunksNameFunction: z.ZodFunction>], z.ZodUnknown>, z.ZodUnknown>; +export type OptimizationSplitChunksNameFunction = (module?: Module) => unknown; -// @public (undocumented) -export type OptimizationSplitChunksOptions = z.infer; +// @public +export type OptimizationSplitChunksOptions = { + cacheGroups?: Record; + fallbackCacheGroup?: { + chunks?: OptimizationSplitChunksChunks; + minSize?: number; + maxSize?: number; + maxAsyncSize?: number; + maxInitialSize?: number; + automaticNameDelimiter?: string; + }; + hidePathInfo?: boolean; +} & SharedOptimizationSplitChunksCacheGroup; // @public (undocumented) -const optimizationSplitChunksOptions: z.ZodObject<{ - chunks: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; - defaultSizeTypes: z.ZodOptional>; - minChunks: z.ZodOptional; - usedExports: z.ZodOptional; - name: z.ZodOptional]>, z.ZodFunction>], z.ZodUnknown>, z.ZodUnknown>]>>; - minSize: z.ZodOptional]>>; - maxSize: z.ZodOptional]>>; - maxAsyncSize: z.ZodOptional]>>; - maxInitialSize: z.ZodOptional]>>; - maxAsyncRequests: z.ZodOptional; - maxInitialRequests: z.ZodOptional; - automaticNameDelimiter: z.ZodOptional; - cacheGroups: z.ZodOptional, z.ZodObject<{ - chunks: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; - defaultSizeTypes: z.ZodOptional>; - minChunks: z.ZodOptional; - usedExports: z.ZodOptional; - name: z.ZodOptional]>, z.ZodFunction>], z.ZodUnknown>, z.ZodUnknown>]>>; - minSize: z.ZodOptional]>>; - maxSize: z.ZodOptional]>>; - maxAsyncSize: z.ZodOptional]>>; - maxInitialSize: z.ZodOptional]>>; - maxAsyncRequests: z.ZodOptional; - maxInitialRequests: z.ZodOptional; - automaticNameDelimiter: z.ZodOptional; - test: z.ZodOptional]>, z.ZodFunction], z.ZodUnknown>, z.ZodUnknown>]>>; - priority: z.ZodOptional; - enforce: z.ZodOptional; - filename: z.ZodOptional; - reuseExistingChunk: z.ZodOptional; - type: z.ZodOptional]>>; - idHint: z.ZodOptional; - }, "strict", z.ZodTypeAny, { - type?: string | RegExp | undefined; - filename?: string | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }, { - type?: string | RegExp | undefined; - filename?: string | undefined; - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }>]>>>; - fallbackCacheGroup: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; - minSize: z.ZodOptional; - maxSize: z.ZodOptional; - maxAsyncSize: z.ZodOptional; - maxInitialSize: z.ZodOptional; - automaticNameDelimiter: z.ZodOptional; - }, "strict", z.ZodTypeAny, { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - }, { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - }>>; - hidePathInfo: z.ZodOptional; -}, "strict", z.ZodTypeAny, { - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - cacheGroups?: Record unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }> | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - hidePathInfo?: boolean | undefined; -}, { - name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - cacheGroups?: Record unknown) | undefined; - priority?: number | undefined; - test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - defaultSizeTypes?: string[] | undefined; - minChunks?: number | undefined; - usedExports?: boolean | undefined; - minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - }> | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; - maxSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - hidePathInfo?: boolean | undefined; -}>; +type OptimizationSplitChunksSizes = number | Record; // @public (undocumented) interface Optimize { @@ -7059,6 +6610,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7074,6 +6629,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7089,6 +6648,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/auto": z.ZodOptional>; @@ -7105,6 +6668,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7120,6 +6687,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7135,6 +6706,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/dynamic": z.ZodOptional>; @@ -7151,6 +6726,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7166,6 +6745,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7181,6 +6764,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/esm": z.ZodOptional>; @@ -7197,6 +6784,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7212,6 +6803,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7227,6 +6822,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; }, "strict", z.ZodTypeAny, { javascript?: { @@ -7244,6 +6843,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -7274,6 +6877,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -7290,6 +6897,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -7306,6 +6917,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }, { javascript?: { @@ -7323,6 +6938,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -7353,6 +6972,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -7369,6 +6992,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -7385,6 +7012,10 @@ const parserOptionsByModuleType: z.ZodUnion<[z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }>, z.ZodRecord>]>; @@ -7446,6 +7077,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7461,6 +7096,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7476,6 +7115,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/auto": z.ZodOptional>; @@ -7492,6 +7135,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7507,6 +7154,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7522,6 +7173,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/dynamic": z.ZodOptional>; @@ -7538,6 +7193,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7553,6 +7212,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7568,6 +7231,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/esm": z.ZodOptional>; @@ -7584,6 +7251,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7599,6 +7270,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -7614,6 +7289,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; }, "strict", z.ZodTypeAny, { javascript?: { @@ -7631,6 +7310,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -7661,6 +7344,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -7677,6 +7364,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -7693,6 +7384,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }, { javascript?: { @@ -7710,6 +7405,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -7740,6 +7439,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -7756,6 +7459,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -7772,6 +7479,10 @@ const parserOptionsByModuleTypeKnown: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }>; @@ -7829,6 +7540,10 @@ const performance_2: z.ZodUnion<[z.ZodObject<{ // @public (undocumented) type PitchLoaderDefinitionFunction = (this: LoaderContext & ContextAdditions, remainingRequest: string, previousRequest: string, data: object) => string | void | Buffer | Promise; +// @public (undocumented) +type Plugin_2 = RspackPluginInstance | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | Falsy; +export { Plugin_2 as Plugin } + // @public (undocumented) type PluginImportConfig = { libraryName: string; @@ -7847,10 +7562,7 @@ type PluginImportConfig = { type PluginImportOptions = PluginImportConfig[] | undefined; // @public (undocumented) -export type Plugins = z.infer; - -// @public (undocumented) -const plugins: z.ZodArray, z.ZodUnion<[z.ZodLiteral, z.ZodLiteral<0>, z.ZodLiteral<"">, z.ZodNull, z.ZodUndefined]>]>, "many">; +export type Plugins = Plugin_2[]; // @public (undocumented) type PrintedElement = { @@ -8528,17 +8240,6 @@ declare namespace rspackExports { CacheOptions, StatsOptions, StatsValue, - RspackPluginInstance, - RspackPluginFunction, - WebpackCompiler, - WebpackPluginInstance, - WebpackPluginFunction, - Plugins, - OptimizationRuntimeChunk, - OptimizationSplitChunksNameFunction, - OptimizationSplitChunksCacheGroup, - OptimizationSplitChunksOptions, - Optimization, RspackFutureOptions, LazyCompilationOptions, Incremental, @@ -8598,7 +8299,19 @@ declare namespace rspackExports { ExternalItemObjectUnknown, ExternalItemFunctionData, ExternalItem, - Externals + Externals, + RspackPluginInstance, + RspackPluginFunction, + WebpackCompiler, + WebpackPluginInstance, + WebpackPluginFunction, + Plugin_2 as Plugin, + Plugins, + OptimizationRuntimeChunk, + OptimizationSplitChunksNameFunction, + OptimizationSplitChunksCacheGroup, + OptimizationSplitChunksOptions, + Optimization } } @@ -9948,11 +9661,9 @@ export const rspackOptions: z.ZodObject<{ source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -9977,6 +9688,8 @@ export const rspackOptions: z.ZodObject<{ loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -10025,11 +9738,9 @@ export const rspackOptions: z.ZodObject<{ source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -10054,6 +9765,8 @@ export const rspackOptions: z.ZodObject<{ loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -10104,7 +9817,7 @@ export const rspackOptions: z.ZodObject<{ moduleIds: z.ZodOptional>; chunkIds: z.ZodOptional>; minimize: z.ZodOptional; - minimizer: z.ZodOptional, z.ZodUnion<[z.ZodType, z.ZodUnion<[z.ZodLiteral, z.ZodLiteral<0>, z.ZodLiteral<"">, z.ZodNull, z.ZodUndefined]>]>]>, "many">>; + minimizer: z.ZodOptional, z.ZodUnion<[z.ZodType, z.ZodUnion<[z.ZodLiteral, z.ZodLiteral<0>, z.ZodLiteral<"">, z.ZodNull, z.ZodUndefined]>]>]>, "many">>; mergeDuplicateChunks: z.ZodOptional; splitChunks: z.ZodOptional, z.ZodObject<{ chunks: z.ZodOptional, z.ZodType]>, z.ZodFunction], z.ZodUnknown>, z.ZodBoolean>]>>; @@ -10144,16 +9857,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10164,16 +9877,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10188,16 +9901,16 @@ export const rspackOptions: z.ZodObject<{ maxInitialSize: z.ZodOptional; automaticNameDelimiter: z.ZodOptional; }, "strict", z.ZodTypeAny, { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; }, { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10205,12 +9918,12 @@ export const rspackOptions: z.ZodObject<{ hidePathInfo: z.ZodOptional; }, "strict", z.ZodTypeAny, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + maxSize?: number | Record | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10221,16 +9934,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10238,9 +9951,9 @@ export const rspackOptions: z.ZodObject<{ automaticNameDelimiter?: string | undefined; }> | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10248,12 +9961,12 @@ export const rspackOptions: z.ZodObject<{ hidePathInfo?: boolean | undefined; }, { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + maxSize?: number | Record | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10264,16 +9977,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10281,9 +9994,9 @@ export const rspackOptions: z.ZodObject<{ automaticNameDelimiter?: string | undefined; }> | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; @@ -10319,20 +10032,14 @@ export const rspackOptions: z.ZodObject<{ nodeEnv: z.ZodOptional]>>; emitOnErrors: z.ZodOptional; }, "strict", z.ZodTypeAny, { - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - usedExports?: boolean | "global" | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + maxSize?: number | Record | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10343,16 +10050,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10360,15 +10067,23 @@ export const rspackOptions: z.ZodObject<{ automaticNameDelimiter?: string | undefined; }> | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; } | undefined; hidePathInfo?: boolean | undefined; } | undefined; + usedExports?: boolean | "global" | undefined; + providedExports?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | t.RspackPluginInstance | "..." | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; runtimeChunk?: boolean | "single" | "multiple" | { name?: string | ((args_0: { name: string; @@ -10377,28 +10092,20 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; mangleExports?: boolean | "size" | "deterministic" | undefined; nodeEnv?: string | false | undefined; emitOnErrors?: boolean | undefined; }, { - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - usedExports?: boolean | "global" | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + maxSize?: number | Record | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10409,16 +10116,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -10426,15 +10133,23 @@ export const rspackOptions: z.ZodObject<{ automaticNameDelimiter?: string | undefined; }> | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; } | undefined; hidePathInfo?: boolean | undefined; } | undefined; + usedExports?: boolean | "global" | undefined; + providedExports?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | t.RspackPluginInstance | "..." | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; runtimeChunk?: boolean | "single" | "multiple" | { name?: string | ((args_0: { name: string; @@ -10443,8 +10158,6 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; mangleExports?: boolean | "size" | "deterministic" | undefined; @@ -10453,7 +10166,7 @@ export const rspackOptions: z.ZodObject<{ }>>; resolve: z.ZodOptional>; resolveLoader: z.ZodOptional>; - plugins: z.ZodOptional, z.ZodUnion<[z.ZodLiteral, z.ZodLiteral<0>, z.ZodLiteral<"">, z.ZodNull, z.ZodUndefined]>]>, "many">>; + plugins: z.ZodOptional, z.ZodUnion<[z.ZodLiteral, z.ZodLiteral<0>, z.ZodLiteral<"">, z.ZodNull, z.ZodUndefined]>]>, "many">>; devServer: z.ZodOptional>; module: z.ZodOptional, z.ZodType]>, z.ZodUnion<[z.ZodLiteral, z.ZodLiteral<0>, z.ZodLiteral<"">, z.ZodNull, z.ZodUndefined]>]>, "many">>; @@ -10512,6 +10225,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10527,6 +10244,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10542,6 +10263,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/auto": z.ZodOptional>; @@ -10558,6 +10283,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10573,6 +10302,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10588,6 +10321,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/dynamic": z.ZodOptional>; @@ -10604,6 +10341,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10619,6 +10360,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10634,6 +10379,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; "javascript/esm": z.ZodOptional>; @@ -10650,6 +10399,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence: z.ZodOptional; worker: z.ZodOptional, z.ZodBoolean]>>; overrideStrict: z.ZodOptional>; + requireAsExpression: z.ZodOptional; + requireDynamic: z.ZodOptional; + requireResolve: z.ZodOptional; + importDynamic: z.ZodOptional; }, "strict", z.ZodTypeAny, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10665,6 +10418,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }, { url?: boolean | "relative" | undefined; dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined; @@ -10680,6 +10437,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; }>>; }, "strict", z.ZodTypeAny, { javascript?: { @@ -10697,6 +10458,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -10727,6 +10492,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -10743,6 +10512,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -10759,6 +10532,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }, { javascript?: { @@ -10776,6 +10553,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -10806,6 +10587,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -10822,6 +10607,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -10838,6 +10627,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; }>, z.ZodRecord>]>>; generator: z.ZodOptional> | undefined; generator?: Record> | { @@ -11213,6 +11022,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -11243,6 +11056,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -11259,6 +11076,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -11275,6 +11096,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; } | Record> | undefined; generator?: Record> | { @@ -11363,6 +11188,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -11393,6 +11222,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -11409,6 +11242,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -11425,6 +11262,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; } | Record> | undefined; generator?: Record> | { @@ -11779,11 +11620,9 @@ export const rspackOptions: z.ZodObject<{ source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -11808,6 +11647,8 @@ export const rspackOptions: z.ZodObject<{ loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -11855,20 +11696,14 @@ export const rspackOptions: z.ZodObject<{ } | undefined; snapshot?: {} | undefined; optimization?: { - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - usedExports?: boolean | "global" | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + maxSize?: number | Record | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -11879,16 +11714,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -11896,15 +11731,23 @@ export const rspackOptions: z.ZodObject<{ automaticNameDelimiter?: string | undefined; }> | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; } | undefined; hidePathInfo?: boolean | undefined; } | undefined; + usedExports?: boolean | "global" | undefined; + providedExports?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | t.RspackPluginInstance | "..." | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; runtimeChunk?: boolean | "single" | "multiple" | { name?: string | ((args_0: { name: string; @@ -11913,8 +11756,6 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; mangleExports?: boolean | "size" | "deterministic" | undefined; @@ -11922,7 +11763,7 @@ export const rspackOptions: z.ZodObject<{ emitOnErrors?: boolean | undefined; } | undefined; resolveLoader?: t.ResolveOptions | undefined; - plugins?: (false | "" | 0 | RspackPluginInstance | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; + plugins?: (false | "" | 0 | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; devServer?: DevServer | undefined; bail?: boolean | undefined; }, { @@ -11945,6 +11786,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; css?: { namedExports?: boolean | undefined; @@ -11975,6 +11820,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/dynamic"?: { url?: boolean | "relative" | undefined; @@ -11991,6 +11840,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; "javascript/esm"?: { url?: boolean | "relative" | undefined; @@ -12007,6 +11860,10 @@ export const rspackOptions: z.ZodObject<{ strictExportPresence?: boolean | undefined; worker?: boolean | string[] | undefined; overrideStrict?: "strict" | "non-strict" | undefined; + requireAsExpression?: boolean | undefined; + requireDynamic?: boolean | undefined; + requireResolve?: boolean | undefined; + importDynamic?: boolean | undefined; } | undefined; } | Record> | undefined; generator?: Record> | { @@ -12361,11 +12218,9 @@ export const rspackOptions: z.ZodObject<{ source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -12390,6 +12245,8 @@ export const rspackOptions: z.ZodObject<{ loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -12437,20 +12294,14 @@ export const rspackOptions: z.ZodObject<{ } | undefined; snapshot?: {} | undefined; optimization?: { - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | RspackPluginInstance | "..." | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - usedExports?: boolean | "global" | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + maxSize?: number | Record | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -12461,16 +12312,16 @@ export const rspackOptions: z.ZodObject<{ filename?: string | undefined; name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined; priority?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined; enforce?: boolean | undefined; + maxSize?: number | Record | undefined; reuseExistingChunk?: boolean | undefined; idHint?: string | undefined; - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; defaultSizeTypes?: string[] | undefined; minChunks?: number | undefined; - usedExports?: boolean | undefined; minSize?: number | Record | undefined; - maxSize?: number | Record | undefined; maxAsyncSize?: number | Record | undefined; maxInitialSize?: number | Record | undefined; maxAsyncRequests?: number | undefined; @@ -12478,15 +12329,23 @@ export const rspackOptions: z.ZodObject<{ automaticNameDelimiter?: string | undefined; }> | undefined; fallbackCacheGroup?: { - chunks?: RegExp | "async" | "initial" | "all" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; - minSize?: number | undefined; + chunks?: RegExp | "async" | "all" | "initial" | ((args_0: Chunk, ...args_1: unknown[]) => boolean) | undefined; maxSize?: number | undefined; + minSize?: number | undefined; maxAsyncSize?: number | undefined; maxInitialSize?: number | undefined; automaticNameDelimiter?: string | undefined; } | undefined; hidePathInfo?: boolean | undefined; } | undefined; + usedExports?: boolean | "global" | undefined; + providedExports?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | t.RspackPluginInstance | "..." | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; runtimeChunk?: boolean | "single" | "multiple" | { name?: string | ((args_0: { name: string; @@ -12495,8 +12354,6 @@ export const rspackOptions: z.ZodObject<{ removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - providedExports?: boolean | undefined; concatenateModules?: boolean | undefined; innerGraph?: boolean | undefined; mangleExports?: boolean | "size" | "deterministic" | undefined; @@ -12504,7 +12361,7 @@ export const rspackOptions: z.ZodObject<{ emitOnErrors?: boolean | undefined; } | undefined; resolveLoader?: t.ResolveOptions | undefined; - plugins?: (false | "" | 0 | RspackPluginInstance | RspackPluginFunction | WebpackPluginInstance | WebpackPluginFunction | null | undefined)[] | undefined; + plugins?: (false | "" | 0 | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; devServer?: DevServer | undefined; bail?: boolean | undefined; }>; @@ -12896,6 +12753,22 @@ export type SharedObject = { [k: string]: SharedConfig | SharedItem; }; +// @public (undocumented) +type SharedOptimizationSplitChunksCacheGroup = { + chunks?: OptimizationSplitChunksChunks; + defaultSizeTypes?: string[]; + minChunks?: number; + usedExports?: boolean; + name?: false | OptimizationSplitChunksName; + minSize?: OptimizationSplitChunksSizes; + maxSize?: OptimizationSplitChunksSizes; + maxAsyncSize?: OptimizationSplitChunksSizes; + maxInitialSize?: OptimizationSplitChunksSizes; + maxAsyncRequests?: number; + maxInitialRequests?: number; + automaticNameDelimiter?: string; +}; + // @public (undocumented) class SharePlugin { constructor(options: SharePluginOptions); @@ -13223,11 +13096,9 @@ const statsOptions: z.ZodObject<{ source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -13252,6 +13123,8 @@ const statsOptions: z.ZodObject<{ loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -13300,11 +13173,9 @@ const statsOptions: z.ZodObject<{ source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -13329,6 +13200,8 @@ const statsOptions: z.ZodObject<{ loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -13490,11 +13363,9 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -13519,6 +13390,8 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -13567,11 +13440,9 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no source?: boolean | undefined; publicPath?: boolean | undefined; all?: boolean | undefined; - chunks?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; assets?: boolean | undefined; + chunks?: boolean | undefined; modules?: boolean | undefined; entrypoints?: boolean | "auto" | undefined; chunkGroups?: boolean | undefined; @@ -13596,6 +13467,8 @@ const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["normal", "no loggingTrace?: boolean | undefined; runtimeModules?: boolean | undefined; children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; optimizationBailout?: boolean | undefined; groupModulesByType?: boolean | undefined; groupModulesByCacheStatus?: boolean | undefined; @@ -13883,7 +13756,19 @@ declare namespace t { ExternalItemObjectUnknown, ExternalItemFunctionData, ExternalItem, - Externals + Externals, + RspackPluginInstance, + RspackPluginFunction, + WebpackCompiler, + WebpackPluginInstance, + WebpackPluginFunction, + Plugin_2 as Plugin, + Plugins, + OptimizationRuntimeChunk, + OptimizationSplitChunksNameFunction, + OptimizationSplitChunksCacheGroup, + OptimizationSplitChunksOptions, + Optimization } } diff --git a/packages/rspack/package.json b/packages/rspack/package.json index 9c190b01409..a7136d4310d 100644 --- a/packages/rspack/package.json +++ b/packages/rspack/package.json @@ -1,6 +1,6 @@ { "name": "@rspack/core", - "version": "1.0.8", + "version": "1.0.9", "webpackVersion": "5.75.0", "license": "MIT", "description": "The fast Rust-based web bundler with webpack-compatible API", diff --git a/packages/rspack/src/config/adapter.ts b/packages/rspack/src/config/adapter.ts index 2bdac595950..f00c088dc48 100644 --- a/packages/rspack/src/config/adapter.ts +++ b/packages/rspack/src/config/adapter.ts @@ -682,7 +682,11 @@ function getRawJavascriptParserOptions( ? ["..."] : [] : parser.worker, - overrideStrict: parser.overrideStrict + overrideStrict: parser.overrideStrict, + requireAsExpression: parser.requireAsExpression, + requireDynamic: parser.requireDynamic, + requireResolve: parser.requireResolve, + importDynamic: parser.importDynamic }; } diff --git a/packages/rspack/src/config/defaults.ts b/packages/rspack/src/config/defaults.ts index 996ccf263e0..11f18968572 100644 --- a/packages/rspack/src/config/defaults.ts +++ b/packages/rspack/src/config/defaults.ts @@ -251,6 +251,10 @@ const applyJavascriptParserOptionsDefaults = ( D(parserOptions, "exprContextCritical", true); D(parserOptions, "wrappedContextCritical", false); D(parserOptions, "strictExportPresence", false); + D(parserOptions, "requireAsExpression", true); + D(parserOptions, "requireDynamic", true); + D(parserOptions, "requireResolve", true); + D(parserOptions, "importDynamic", true); D(parserOptions, "worker", ["..."]); D(parserOptions, "importMeta", true); }; diff --git a/packages/rspack/src/config/types.ts b/packages/rspack/src/config/types.ts index 5dadd5b19e0..4b9b94135d4 100644 --- a/packages/rspack/src/config/types.ts +++ b/packages/rspack/src/config/types.ts @@ -1,5 +1,8 @@ import type { JsAssetInfo } from "@rspack/binding"; import type { PathData } from "../Compilation"; +import type { Compiler } from "../Compiler"; +import type { Module } from "../Module"; +import type { Chunk } from "../exports"; export type FilenameTemplate = string; @@ -460,4 +463,312 @@ export type ExternalItem = * ``` * */ export type Externals = ExternalItem | ExternalItem[]; +//#region Plugins +export interface RspackPluginInstance { + apply: (compiler: Compiler) => void; + [k: string]: any; +} + +export type RspackPluginFunction = (this: Compiler, compiler: Compiler) => void; + +// The Compiler type of webpack is not exactly the same as Rspack. +// It is allowed to use webpack plugins in in the Rspack config, +// so we have defined a loose type here to adapt to webpack plugins. +export type WebpackCompiler = any; + +export interface WebpackPluginInstance { + apply: (compiler: WebpackCompiler) => void; + [k: string]: any; +} + +export type WebpackPluginFunction = ( + this: WebpackCompiler, + compiler: WebpackCompiler +) => void; + +export type Plugin = + | RspackPluginInstance + | RspackPluginFunction + | WebpackPluginInstance + | WebpackPluginFunction + | Falsy; + +export type Plugins = Plugin[]; +//#endregion + +//#region Optimization +/** Used to control how the runtime chunk is generated. */ + +export type OptimizationRuntimeChunk = + | boolean + | "single" + | "multiple" + | { + name?: string | ((value: { name: string }) => string); + }; + +export type OptimizationSplitChunksNameFunction = (module?: Module) => unknown; + +type OptimizationSplitChunksName = + | string + | false + | OptimizationSplitChunksNameFunction; + +type OptimizationSplitChunksSizes = number | Record; + +type OptimizationSplitChunksChunks = + | "initial" + | "async" + | "all" + | RegExp + | ((chunk: Chunk) => boolean); + +type SharedOptimizationSplitChunksCacheGroup = { + /** + * This indicates which chunks will be selected for optimization. + * @default 'async'' + * */ + chunks?: OptimizationSplitChunksChunks; + + /** Sets the size types which are used when a number is used for sizes. */ + defaultSizeTypes?: string[]; + + /** + * The minimum times must a module be shared among chunks before splitting. + * @default 1 + */ + minChunks?: number; + + /** + * Enabling this, the splitting of chunks will be grouped based on the usage of modules exports in different runtimes, + * ensuring the optimal loading size in each runtime. + */ + usedExports?: boolean; + + /** + * The name of the split chunk. + * @default false + * */ + name?: false | OptimizationSplitChunksName; + + /** + * Minimum size, in bytes, for a chunk to be generated. + * + * The value is `20000` in production mode. + * The value is `10000` in others mode. + */ + minSize?: OptimizationSplitChunksSizes; + + /** Maximum size, in bytes, for a chunk to be generated. */ + maxSize?: OptimizationSplitChunksSizes; + + /** Maximum size, in bytes, for a async chunk to be generated. */ + maxAsyncSize?: OptimizationSplitChunksSizes; + + /** Maximum size, in bytes, for a initial chunk to be generated. */ + maxInitialSize?: OptimizationSplitChunksSizes; + + /** + * Maximum number of parallel requests when on-demand loading. + * @default 30 + * */ + maxAsyncRequests?: number; + + /** + * Maximum number of parallel requests at an entry point. + * @default 30 + */ + maxInitialRequests?: number; + + /** + * Tell Rspack what delimiter to use for the generated names. + * + * @default '-'' + */ + automaticNameDelimiter?: string; +}; + +/** How to splitting chunks. */ +export type OptimizationSplitChunksCacheGroup = { + /** Controls which modules are selected by this cache group. */ + test?: string | RegExp | ((module: Module) => unknown); + + /** + * A module can belong to multiple cache groups. + * @default -20 + */ + priority?: number; + + /** + * Tells Rspack to ignore `splitChunks.minSize`, `splitChunks.minChunks`, `splitChunks.maxAsyncRequests` and `splitChunks.maxInitialRequests` options and always create chunks for this cache group. + */ + enforce?: boolean; + + /** Allows to override the filename when and only when it's an initial chunk. */ + filename?: string; + + /** + * Whether to reuse existing chunks when possible. + * @default false + * */ + reuseExistingChunk?: boolean; + + /** Allows to assign modules to a cache group by module type. */ + type?: string | RegExp; + + /** Sets the hint for chunk id. It will be added to chunk's filename. */ + idHint?: string; +} & SharedOptimizationSplitChunksCacheGroup; + +/** Tell Rspack how to splitting chunks. */ +export type OptimizationSplitChunksOptions = { + /** + * Options for module cache group + * */ + cacheGroups?: Record; + + /** + * Options for modules not selected by any other group. + */ + fallbackCacheGroup?: { + chunks?: OptimizationSplitChunksChunks; + minSize?: number; + maxSize?: number; + maxAsyncSize?: number; + maxInitialSize?: number; + automaticNameDelimiter?: string; + }; + + /** + * Prevents exposing path info when creating names for parts splitted by maxSize. + * + * The value is `true` in production mode. + * The value is `false` in development mode. + * */ + hidePathInfo?: boolean; +} & SharedOptimizationSplitChunksCacheGroup; + +export type Optimization = { + /** + * Which algorithm to use when choosing module ids. + */ + moduleIds?: "named" | "natural" | "deterministic"; + + /** + * Which algorithm to use when choosing chunk ids. + */ + chunkIds?: "natural" | "named" | "deterministic"; + + /** + * Whether to minimize the bundle. + * The value is `true` in production mode. + * The value is `false` in development mode. + */ + minimize?: boolean; + + /** + * Customize the minimizer. + * By default, `rspack.SwcJsMinimizerRspackPlugin` and `rspack.LightningCssMinimizerRspackPlugin` are used. + */ + minimizer?: Array<"..." | Plugin>; + + /** + * Whether to merge chunks which contain the same modules. + * Setting optimization.mergeDuplicateChunks to false will disable this optimization. + * @default true + */ + mergeDuplicateChunks?: boolean; + + /** + * Support splitting chunks. + * It is enabled by default for dynamically imported modules. + * To turn it off, set it to false. + * */ + splitChunks?: false | OptimizationSplitChunksOptions; + + /** + * Used to control how the runtime chunk is generated. + * Setting it to true or 'multiple' will add an additional chunk containing only the runtime for each entry point. + * Setting it to 'single' will extract the runtime code of all entry points into a single separate chunk. + * @default false + */ + runtimeChunk?: OptimizationRuntimeChunk; + + /** Detect and remove modules from chunks these modules are already included in all parents. */ + removeAvailableModules?: boolean; + + /** + * Remove empty chunks generated in the compilation. + * @default true + * */ + removeEmptyChunks?: boolean; + + /** + * Adds an additional hash compilation pass after the assets have been processed to get the correct asset content hashes. + * + * The value is `true` in production mode. + * The value is `false` in development mode. + */ + realContentHash?: boolean; + + /** + * Tells Rspack to recognise the sideEffects flag in package.json or rules to skip over modules which are flagged to contain no side effects when exports are not used. + * + * The value is `true` in production mode. + * The value is `false` in development mode. + * */ + sideEffects?: "flag" | boolean; + + /** + * After enabling, Rspack will analyze which exports the module provides, including re-exported modules. + * @default true + * */ + providedExports?: boolean; + + /** + * Tells Rspack to find segments of the module graph which can be safely concatenated into a single module. + * + * The value is `true` in production mode. + * The value is `false` in development mode. + */ + concatenateModules?: boolean; + + /** + * Tells Rspack whether to perform a more detailed analysis of variable assignments. + * + * The value is `true` in production mode. + * The value is `false` in development mode. + */ + innerGraph?: boolean; + + /** + * Tells Rspack to determine used exports for each module. + * + * The value is `true` in production mode. + * The value is `false` in development mode. + * */ + usedExports?: "global" | boolean; + + /** + * Allows to control export mangling. + * + * The value is `isdeterministic` in production mode. + * The value is `false` in development mode. + */ + mangleExports?: "size" | "deterministic" | boolean; + + /** + * Tells Rspack to set process.env.NODE_ENV to a given string value. + * @default false + */ + nodeEnv?: string | false; + + /** + * Emit assets whenever there are errors while compiling. + * + * The value is `false` in production mode. + * The value is `true` in development mode. + * */ + emitOnErrors?: boolean; +}; //#endregion diff --git a/packages/rspack/src/config/zod.ts b/packages/rspack/src/config/zod.ts index 76e5559549b..4d0a4a60fd0 100644 --- a/packages/rspack/src/config/zod.ts +++ b/packages/rspack/src/config/zod.ts @@ -2,10 +2,8 @@ import nodePath from "node:path"; import type { JsAssetInfo, RawFuncUseCtx } from "@rspack/binding"; import type * as webpackDevServer from "webpack-dev-server"; import { z } from "zod"; - -import type { Compilation, Compiler } from ".."; import { Chunk } from "../Chunk"; -import type { PathData } from "../Compilation"; +import type { Compilation, PathData } from "../Compilation"; import { Module } from "../Module"; import type * as t from "./types"; @@ -53,6 +51,7 @@ const falsy = z.union([ z.null(), z.undefined() ]) satisfies z.ZodType; + //#endregion //#region Entry @@ -589,6 +588,10 @@ const reexportExportsPresence = z const strictExportPresence = z.boolean(); const worker = z.array(z.string()).or(z.boolean()); const overrideStrict = z.enum(["strict", "non-strict"]); +const requireAsExpression = z.boolean(); +const requireDynamic = z.boolean(); +const requireResolve = z.boolean(); +const importDynamic = z.boolean(); const javascriptParserOptions = z.strictObject({ dynamicImportMode: dynamicImportMode.optional(), @@ -604,7 +607,13 @@ const javascriptParserOptions = z.strictObject({ reexportExportsPresence: reexportExportsPresence.optional(), strictExportPresence: strictExportPresence.optional(), worker: worker.optional(), - overrideStrict: overrideStrict.optional() + overrideStrict: overrideStrict.optional(), + // #region Not available in webpack yet. + requireAsExpression: requireAsExpression.optional(), + requireDynamic: requireDynamic.optional(), + requireResolve: requireResolve.optional(), + importDynamic: importDynamic.optional() + // #endregion }); export type JavascriptParserOptions = z.infer; @@ -1149,37 +1158,17 @@ export type StatsValue = z.infer; //#endregion //#region Plugins -export interface RspackPluginInstance { - apply: (compiler: Compiler) => void; - [k: string]: any; -} -export type RspackPluginFunction = (this: Compiler, compiler: Compiler) => void; - -// The Compiler type of webpack is not exactly the same as Rspack. -// It is allowed to use webpack plugins in in the Rspack config, -// so we have defined a loose type here to adapt to webpack plugins. -export type WebpackCompiler = any; - -export interface WebpackPluginInstance { - apply: (compiler: WebpackCompiler) => void; - [k: string]: any; -} -export type WebpackPluginFunction = ( - this: WebpackCompiler, - compiler: WebpackCompiler -) => void; - const plugin = z.union([ z.custom< - | RspackPluginInstance - | RspackPluginFunction - | WebpackPluginInstance - | WebpackPluginFunction + | t.RspackPluginInstance + | t.RspackPluginFunction + | t.WebpackPluginInstance + | t.WebpackPluginFunction >(), falsy -]); -const plugins = plugin.array(); -export type Plugins = z.infer; +]) satisfies z.ZodType; + +const plugins = plugin.array() satisfies z.ZodType; //#endregion //#region Optimization @@ -1198,18 +1187,13 @@ const optimizationRuntimeChunk = z ) .optional() }) - ); -export type OptimizationRuntimeChunk = z.infer; + ) satisfies z.ZodType; const optimizationSplitChunksNameFunction = z.function().args( z.instanceof(Module).optional() // FIXME: z.array(z.instanceof(Chunk)).optional(), z.string() // FIXME: Chunk[], cacheChunkKey -); - -export type OptimizationSplitChunksNameFunction = z.infer< - typeof optimizationSplitChunksNameFunction ->; +) satisfies z.ZodType; const optimizationSplitChunksName = z .string() @@ -1257,10 +1241,7 @@ const optimizationSplitChunksCacheGroup = z.strictObject({ type: z.string().or(z.instanceof(RegExp)).optional(), idHint: z.string().optional(), ...sharedOptimizationSplitChunksCacheGroup -}); -export type OptimizationSplitChunksCacheGroup = z.infer< - typeof optimizationSplitChunksCacheGroup ->; +}) satisfies z.ZodType; const optimizationSplitChunksOptions = z.strictObject({ cacheGroups: z @@ -1278,10 +1259,7 @@ const optimizationSplitChunksOptions = z.strictObject({ .optional(), hidePathInfo: z.boolean().optional(), ...sharedOptimizationSplitChunksCacheGroup -}); -export type OptimizationSplitChunksOptions = z.infer< - typeof optimizationSplitChunksOptions ->; +}) satisfies z.ZodType; const optimization = z.strictObject({ moduleIds: z.enum(["named", "natural", "deterministic"]).optional(), @@ -1302,8 +1280,7 @@ const optimization = z.strictObject({ mangleExports: z.enum(["size", "deterministic"]).or(z.boolean()).optional(), nodeEnv: z.union([z.string(), z.literal(false)]).optional(), emitOnErrors: z.boolean().optional() -}); -export type Optimization = z.infer; +}) satisfies z.ZodType; //#endregion //#region Experiments diff --git a/packages/rspack/src/loader-runner/index.ts b/packages/rspack/src/loader-runner/index.ts index 91486262407..0615254b600 100644 --- a/packages/rspack/src/loader-runner/index.ts +++ b/packages/rspack/src/loader-runner/index.ts @@ -556,7 +556,7 @@ export async function runLoaders( loaderContext.version = 2; loaderContext.sourceMap = compiler.options.devtool ? isUseSourceMap(compiler.options.devtool) - : false; + : context._module.useSourceMap ?? false; loaderContext.mode = compiler.options.mode; Object.assign(loaderContext, compiler.options.loader); diff --git a/tests/plugin-test/copy-plugin/CopyPlugin.test.js b/tests/plugin-test/copy-plugin/CopyPlugin.test.js index 6013c8371c0..18f10dba70f 100644 --- a/tests/plugin-test/copy-plugin/CopyPlugin.test.js +++ b/tests/plugin-test/copy-plugin/CopyPlugin.test.js @@ -42,6 +42,19 @@ describe("CopyPlugin", () => { .catch(done); }); + it("should copy files when the directory name contains brackets", done => { + runEmit({ + expectedAssetKeys: ["file[1].txt"], + patterns: [ + { + from: "directory[1]" + } + ] + }) + .then(done) + .catch(done); + }); + it("should copy files to new directory", done => { runEmit({ expectedAssetKeys: [ @@ -199,8 +212,8 @@ describe("CopyPlugin", () => { it("should works with multiple patterns as String", done => { runEmit({ - expectedAssetKeys: ["binextension.bin", "file.txt", "noextension"], - patterns: ["binextension.bin", "file.txt", "noextension"] + expectedAssetKeys: ["binextension.bin", "file.txt", "noextension", "file[1].txt"], + patterns: ["binextension.bin", "file.txt", "noextension", "file[1].txt"] }) .then(done) .catch(done); @@ -208,7 +221,7 @@ describe("CopyPlugin", () => { it("should works with multiple patterns as Object", done => { runEmit({ - expectedAssetKeys: ["binextension.bin", "file.txt", "noextension"], + expectedAssetKeys: ["binextension.bin", "file.txt", "noextension", "file[1].txt"], patterns: [ { from: "binextension.bin" @@ -218,6 +231,9 @@ describe("CopyPlugin", () => { }, { from: "noextension" + }, + { + from: "file[1].txt" } ] }) diff --git a/tests/plugin-test/copy-plugin/build/main.js b/tests/plugin-test/copy-plugin/build/main.js index a29a6dbf659..8423f9ed15a 100644 --- a/tests/plugin-test/copy-plugin/build/main.js +++ b/tests/plugin-test/copy-plugin/build/main.js @@ -1 +1 @@ -(()=>{"use strict";var r={},t={};function e(i){var o=t[i];if(void 0!==o)return o.exports;var n=t[i]={exports:{}};return r[i](n,n.exports,e),n.exports}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(r){if("object"==typeof window)return window}}(),e.rv=function(){return"1.0.7"},(()=>{e.g.importScripts&&(r=e.g.location+"");var r,t=e.g.document;if(!r&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(r=t.currentScript.src),!r)){var i=t.getElementsByTagName("script");if(i.length){for(var o=i.length-1;o>-1&&(!r||!/^http(s?):/.test(r));)r=i[o--].src}}if(!r)throw Error("Automatic publicPath is not supported in this browser");r=r.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=r})(),e.ruid="bundler=rspack@1.0.7",e.p})(); \ No newline at end of file +(()=>{"use strict";var r={},t={};function e(i){var o=t[i];if(void 0!==o)return o.exports;var n=t[i]={exports:{}};return r[i](n,n.exports,e),n.exports}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(r){if("object"==typeof window)return window}}(),e.rv=function(){return"1.0.8"},(()=>{e.g.importScripts&&(r=e.g.location+"");var r,t=e.g.document;if(!r&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(r=t.currentScript.src),!r)){var i=t.getElementsByTagName("script");if(i.length){for(var o=i.length-1;o>-1&&(!r||!/^http(s?):/.test(r));)r=i[o--].src}}if(!r)throw Error("Automatic publicPath is not supported in this browser");r=r.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=r})(),e.ruid="bundler=rspack@1.0.8",e.p})(); \ No newline at end of file diff --git a/tests/plugin-test/copy-plugin/fixtures/directory[1]/file[1].txt b/tests/plugin-test/copy-plugin/fixtures/directory[1]/file[1].txt new file mode 100644 index 00000000000..3e5126c4e76 --- /dev/null +++ b/tests/plugin-test/copy-plugin/fixtures/directory[1]/file[1].txt @@ -0,0 +1 @@ +new \ No newline at end of file diff --git a/tests/plugin-test/copy-plugin/fixtures/file[1].txt b/tests/plugin-test/copy-plugin/fixtures/file[1].txt new file mode 100644 index 00000000000..3e5126c4e76 --- /dev/null +++ b/tests/plugin-test/copy-plugin/fixtures/file[1].txt @@ -0,0 +1 @@ +new \ No newline at end of file diff --git a/tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/one_js.$6d058bbc5efd37055e19b0df26689355$.css b/tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/one_js.$6d058bbc5efd37055e19$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/one_js.$6d058bbc5efd37055e19b0df26689355$.css rename to tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/one_js.$6d058bbc5efd37055e19$.css diff --git a/tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/two_js.$fe4cd7a6d22e4a1e8f81c3c1558a0b18$.css b/tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/two_js.$fe4cd7a6d22e4a1e8f81$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/two_js.$fe4cd7a6d22e4a1e8f81c3c1558a0b18$.css rename to tests/plugin-test/css-extract/cases/content-entries-with-same-import/expected/two_js.$fe4cd7a6d22e4a1e8f81$.css diff --git a/tests/plugin-test/css-extract/cases/contenthash-1/expected/main.$f31af5dba4768b1ffd65f0ecaac279f5$.css b/tests/plugin-test/css-extract/cases/contenthash-1/expected/main.$f31af5dba4768b1ffd65$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/contenthash-1/expected/main.$f31af5dba4768b1ffd65f0ecaac279f5$.css rename to tests/plugin-test/css-extract/cases/contenthash-1/expected/main.$f31af5dba4768b1ffd65$.css diff --git a/tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryA.$1e75559fa232a6d58745de2435065a41$.css b/tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryA.$1e75559fa232a6d58745$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryA.$1e75559fa232a6d58745de2435065a41$.css rename to tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryA.$1e75559fa232a6d58745$.css diff --git a/tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryB.$abd3c341dd8131fb079194ca087d2993$.css b/tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryB.$abd3c341dd8131fb0791$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryB.$abd3c341dd8131fb079194ca087d2993$.css rename to tests/plugin-test/css-extract/cases/contenthash-multiple-entries/expected/entryB.$abd3c341dd8131fb0791$.css diff --git a/tests/plugin-test/css-extract/cases/contenthash/expected/1.main.$5864503725d81633fe5803681eb1e082$.css b/tests/plugin-test/css-extract/cases/contenthash/expected/1.main.$5864503725d81633fe58$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/contenthash/expected/1.main.$5864503725d81633fe5803681eb1e082$.css rename to tests/plugin-test/css-extract/cases/contenthash/expected/1.main.$5864503725d81633fe58$.css diff --git a/tests/plugin-test/css-extract/cases/contenthash/expected/2.main.$9e561892faa013eb97cd24d47725231d$.css b/tests/plugin-test/css-extract/cases/contenthash/expected/2.main.$9e561892faa013eb97cd$.css similarity index 100% rename from tests/plugin-test/css-extract/cases/contenthash/expected/2.main.$9e561892faa013eb97cd24d47725231d$.css rename to tests/plugin-test/css-extract/cases/contenthash/expected/2.main.$9e561892faa013eb97cd$.css diff --git a/tests/plugin-test/css-extract/cases/js-hash/expected/style.$925bab78b2b6b1d5e7853284484b5765$.2.css b/tests/plugin-test/css-extract/cases/js-hash/expected/style.$925bab78b2b6b1d5e785$.2.css similarity index 100% rename from tests/plugin-test/css-extract/cases/js-hash/expected/style.$925bab78b2b6b1d5e7853284484b5765$.2.css rename to tests/plugin-test/css-extract/cases/js-hash/expected/style.$925bab78b2b6b1d5e785$.2.css diff --git a/tests/plugin-test/css-extract/cases/js-hash/expected/style.$dc7f20eefa5d2300998f2f891a80b581$.1.css b/tests/plugin-test/css-extract/cases/js-hash/expected/style.$dc7f20eefa5d2300998f$.1.css similarity index 100% rename from tests/plugin-test/css-extract/cases/js-hash/expected/style.$dc7f20eefa5d2300998f2f891a80b581$.1.css rename to tests/plugin-test/css-extract/cases/js-hash/expected/style.$dc7f20eefa5d2300998f$.1.css diff --git a/website/docs/en/plugins/webpack/split-chunks-plugin.mdx b/website/docs/en/plugins/webpack/split-chunks-plugin.mdx index 63390cee6c8..acdf30125f1 100644 --- a/website/docs/en/plugins/webpack/split-chunks-plugin.mdx +++ b/website/docs/en/plugins/webpack/split-chunks-plugin.mdx @@ -273,6 +273,12 @@ chunk baz chunk shared-2 (exports only value2) ``` +### splitChunks.defaultSizeTypes + +- **Types:** `string[]` + +Sets the size types which are used when a number is used for sizes. + ### splitChunks.cacheGroups Cache groups can inherit and/or override any options from `splitChunks.*`; but `test`, `priority` and `reuseExistingChunk` can only be configured on cache group level. To disable any of the default cache groups, set them to `false`. @@ -358,3 +364,9 @@ cacheGroup: { In chunks Foo and Bar, the module B, due to the configuration of cacheGroup, will be split into a new chunk that only contains module B. This new chunk is identical in terms of the modules it contains with chunk Bar, so chunk Bar can be directly reused. If the setting of reuseExistingChunk is set to `false`, then the module B in chunks Bar and Foo will be moved to a new chunk, and chunk Bar, since it no longer contains any modules, will be deleted as an empty chunk. + +#### splitChunks.cacheGroups.\{cacheGroup\}.type + +- **Types:** `string | RegExp` + +Allows to assign modules to a cache group by module type. diff --git a/website/docs/zh/plugins/webpack/split-chunks-plugin.mdx b/website/docs/zh/plugins/webpack/split-chunks-plugin.mdx index 53b497e0887..88da4d41502 100644 --- a/website/docs/zh/plugins/webpack/split-chunks-plugin.mdx +++ b/website/docs/zh/plugins/webpack/split-chunks-plugin.mdx @@ -263,6 +263,12 @@ chunk baz chunk shared-2 (exports only value2) ``` +### splitChunks.defaultSizeTypes + +- **类型:** `string[]` + +用来控制在计算文件大小时应该使用哪些大小类型 + ### splitChunks.cacheGroups 缓存组可以继承和/或覆盖来自 `splitChunks.*` 的任何选项。但是 `test`、`priority` 和 `reuseExistingChunk` 只能在缓存组级别上进行配置。将它们设置为 `false` 以禁用任何默认缓存组。 @@ -348,3 +354,9 @@ cacheGroup: { 由于 cacheGroup 的配置,在 chunk Foo 和 chunk Bar 中的 module B 会被拆分到一个新的 chunk 中,该 chunk 只包含 module B,这个新 chunk 和 chunk Bar 包含的 module 完全一样,因此可以直接复用 chunk Bar。 如果设置 reuseExistingChunk 为 `false`,那么 chunk Bar 和 chunk Foo 中的 module B 会被移到新 chunk 中,chunk Bar 由于不包含任何 module,会作为空 chunk 被删除。 + +#### splitChunks.cacheGroups.\{cacheGroup\}.type + +- **Types:** `string | RegExp` + +允许模块根据模块类型分配给 cache group