diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 98ba8866..35136a1c 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -37,7 +37,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 with: path: ./docs/.vitepress/dist diff --git a/package.json b/package.json index 3c0b4f6f..ea220a8b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "unplugin", "type": "module", - "version": "2.3.8", + "version": "2.3.9", "packageManager": "pnpm@10.15.0", "description": "Unified plugin system for build tools", "license": "MIT", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5df7ad1..d5246674 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,11 +19,11 @@ catalogs: specifier: ^1.7.11 version: 1.7.11 '@rspack/cli': - specifier: ^1.4.11 - version: 1.4.11 + specifier: ^1.5.0 + version: 1.5.0 '@rspack/core': - specifier: ^1.4.11 - version: 1.4.11 + specifier: ^1.5.0 + version: 1.5.0 '@types/fs-extra': specifier: ^11.0.4 version: 11.0.4 @@ -193,10 +193,10 @@ importers: version: 1.7.11(@types/node@24.3.0) '@rspack/cli': specifier: 'catalog:' - version: 1.4.11(@rspack/core@1.4.11(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3) + version: 1.5.0(@rspack/core@1.5.0(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3) '@rspack/core': specifier: 'catalog:' - version: 1.4.11(@swc/helpers@0.5.17) + version: 1.5.0(@swc/helpers@0.5.17) '@types/fs-extra': specifier: 'catalog:' version: 11.0.4 @@ -971,23 +971,23 @@ packages: '@mdn/browser-compat-data@5.7.6': resolution: {integrity: sha512-7xdrMX0Wk7grrTZQwAoy1GkvPMFoizStUoL+VmtUkAxegbCCec+3FKwOM6yc/uGU5+BEczQHXAlWiqvM8JeENg==} - '@module-federation/error-codes@0.17.1': - resolution: {integrity: sha512-n6Elm4qKSjwAPxLUGtwnl7qt4y1dxB8OpSgVvXBIzqI9p27a3ZXshLPLnumlpPg1Qudaj8sLnSnFtt9yGpt5yQ==} + '@module-federation/error-codes@0.18.0': + resolution: {integrity: sha512-Woonm8ehyVIUPXChmbu80Zj6uJkC0dD9SJUZ/wOPtO8iiz/m+dkrOugAuKgoiR6qH4F+yorWila954tBz4uKsQ==} - '@module-federation/runtime-core@0.17.1': - resolution: {integrity: sha512-LCtIFuKgWPQ3E+13OyrVpuTPOWBMI/Ggwsq1Q874YeT8Px28b8tJRCj09DjyRFyhpSPyV/uG80T6iXPAUoLIfQ==} + '@module-federation/runtime-core@0.18.0': + resolution: {integrity: sha512-ZyYhrDyVAhUzriOsVfgL6vwd+5ebYm595Y13KeMf6TKDRoUHBMTLGQ8WM4TDj8JNsy7LigncK8C03fn97of0QQ==} - '@module-federation/runtime-tools@0.17.1': - resolution: {integrity: sha512-4kr6zTFFwGywJx6whBtxsc84V+COAuuBpEdEbPZN//YLXhNB0iz2IGsy9r9wDl+06h84bD+3dQ05l9euRLgXzQ==} + '@module-federation/runtime-tools@0.18.0': + resolution: {integrity: sha512-fSga9o4t1UfXNV/Kh6qFvRyZpPp3EHSPRISNeyT8ZoTpzDNiYzhtw0BPUSSD8m6C6XQh2s/11rI4g80UY+d+hA==} - '@module-federation/runtime@0.17.1': - resolution: {integrity: sha512-vKEN32MvUbpeuB/s6UXfkHDZ9N5jFyDDJnj83UTJ8n4N1jHIJu9VZ6Yi4/Ac8cfdvU8UIK9bIbfVXWbUYZUDsw==} + '@module-federation/runtime@0.18.0': + resolution: {integrity: sha512-+C4YtoSztM7nHwNyZl6dQKGUVJdsPrUdaf3HIKReg/GQbrt9uvOlUWo2NXMZ8vDAnf/QRrpSYAwXHmWDn9Obaw==} - '@module-federation/sdk@0.17.1': - resolution: {integrity: sha512-nlUcN6UTEi+3HWF+k8wPy7gH0yUOmCT+xNatihkIVR9REAnr7BUvHFGlPJmx7WEbLPL46+zJUbtQHvLzXwFhng==} + '@module-federation/sdk@0.18.0': + resolution: {integrity: sha512-Lo/Feq73tO2unjmpRfyyoUkTVoejhItXOk/h5C+4cistnHbTV8XHrW/13fD5e1Iu60heVdAhhelJd6F898Ve9A==} - '@module-federation/webpack-bundler-runtime@0.17.1': - resolution: {integrity: sha512-Swspdgf4PzcbvS9SNKFlBzfq8h/Qxwqjq/xRSqw1pqAZWondZQzwTTqPXhgrg0bFlz7qWjBS/6a8KuH/gRvGaQ==} + '@module-federation/webpack-bundler-runtime@0.18.0': + resolution: {integrity: sha512-TEvErbF+YQ+6IFimhUYKK3a5wapD90d90sLsNpcu2kB3QGT7t4nIluE25duXuZDVUKLz86tEPrza/oaaCWTpvQ==} '@napi-rs/wasm-runtime@1.0.3': resolution: {integrity: sha512-rZxtMsLwjdXkMUGC3WwsPwLNVqVqnTJT6MNIB6e+5fhMcSCPP0AOsNWuMQ5mdCq6HNjs/ZeWAEchpqeprqBD2Q==} @@ -1008,9 +1008,16 @@ packages: resolution: {integrity: sha512-cYxcj5CPn/vo5QSpCZcYzBiLidU5+GlFSqIeNaMgBDtcVRBsBJHZg3pHw999W6nHamFQ1EHuPPByB26tjaJiJw==} engines: {node: '>=6.9.0'} + '@oxc-project/runtime@0.82.3': + resolution: {integrity: sha512-LNh5GlJvYHAnMurO+EyA8jJwN1rki7l3PSHuosDh2I7h00T6/u9rCkUjg/SvPmT1CZzvhuW0y+gf7jcqUy/Usg==} + engines: {node: '>=6.9.0'} + '@oxc-project/types@0.82.2': resolution: {integrity: sha512-WMGSwd9FsNBs/WfqIOH0h3k1LBdjZJQGYjGnC+vla/fh6HUsu5HzGPerRljiq1hgMQ6gs031YJR12VyP57b/hQ==} + '@oxc-project/types@0.82.3': + resolution: {integrity: sha512-6nCUxBnGX0c6qfZW5MaF6/fmu5dHJDMiMPaioKHKs5mi5+8/FHQ7WGjgQIz1zxpmceMYfdIXkOaLYE+ejbuOtA==} + '@pkgr/core@0.1.2': resolution: {integrity: sha512-fdDH1LSGfZdTH2sxdpVMw31BanV28K/Gry0cVFxaNP77neJSkd82mM8ErPNYs9e+0O7SdHBLTDzDgwUuy18RnQ==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -1034,77 +1041,150 @@ packages: cpu: [arm64] os: [android] + '@rolldown/binding-android-arm64@1.0.0-beta.34': + resolution: {integrity: sha512-jf5GNe5jP3Sr1Tih0WKvg2bzvh5T/1TA0fn1u32xSH7ca/p5t+/QRr4VRFCV/na5vjwKEhwWrChsL2AWlY+eoA==} + cpu: [arm64] + os: [android] + '@rolldown/binding-darwin-arm64@1.0.0-beta.33': resolution: {integrity: sha512-7lhhY08v5ZtRq8JJQaJ49fnJombAPnqllKKCDLU/UvaqNAOEyTGC8J1WVOLC4EA4zbXO5U3CCRgVGyAFNH2VtQ==} cpu: [arm64] os: [darwin] + '@rolldown/binding-darwin-arm64@1.0.0-beta.34': + resolution: {integrity: sha512-2F/TqH4QuJQ34tgWxqBjFL3XV1gMzeQgUO8YRtCPGBSP0GhxtoFzsp7KqmQEothsxztlv+KhhT9Dbg3HHwHViQ==} + cpu: [arm64] + os: [darwin] + '@rolldown/binding-darwin-x64@1.0.0-beta.33': resolution: {integrity: sha512-U2iGjcDV7NWyYyhap8YuY0nwrLX6TvX/9i7gBtdEMPm9z3wIUVGNMVdGlA43uqg7xDpRGpEqGnxbeDgiEwYdnA==} cpu: [x64] os: [darwin] + '@rolldown/binding-darwin-x64@1.0.0-beta.34': + resolution: {integrity: sha512-E1QuFslgLWbHQ8Qli/AqUKdfg0pockQPwRxVbhNQ74SciZEZpzLaujkdmOLSccMlSXDfFCF8RPnMoRAzQ9JV8Q==} + cpu: [x64] + os: [darwin] + '@rolldown/binding-freebsd-x64@1.0.0-beta.33': resolution: {integrity: sha512-gd6ASromVHFLlzrjJWMG5CXHkS7/36DEZ8HhvGt2NN8eZALCIuyEx8HMMLqvKA7z4EAztVkdToVrdxpGMsKZxw==} cpu: [x64] os: [freebsd] + '@rolldown/binding-freebsd-x64@1.0.0-beta.34': + resolution: {integrity: sha512-VS8VInNCwnkpI9WeQaWu3kVBq9ty6g7KrHdLxYMzeqz24+w9hg712TcWdqzdY6sn+24lUoMD9jTZrZ/qfVpk0g==} + cpu: [x64] + os: [freebsd] + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.33': resolution: {integrity: sha512-xmeLfkfGthuynO1EpCdyTVr0r4G+wqvnKCuyR6rXOet+hLrq5HNAC2XtP/jU2TB4Bc6aiLYxl868B8CGtFDhcw==} cpu: [arm] os: [linux] + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.34': + resolution: {integrity: sha512-4St4emjcnULnxJYb/5ZDrH/kK/j6PcUgc3eAqH5STmTrcF+I9m/X2xvSF2a2bWv1DOQhxBewThu0KkwGHdgu5w==} + cpu: [arm] + os: [linux] + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.33': resolution: {integrity: sha512-cHGp8yfHL4pes6uaLbO5L58ceFkUK4efd8iE86jClD1QPPDLKiqEXJCFYeuK3OfODuF5EBOmf0SlcUZNEYGdmw==} cpu: [arm64] os: [linux] + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.34': + resolution: {integrity: sha512-a737FTqhFUoWfnebS2SnQ2BS50p0JdukdkUBwy2J06j4hZ6Eej0zEB8vTfAqoCjn8BQKkXBy+3Sx0IRkgwz1gA==} + cpu: [arm64] + os: [linux] + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.33': resolution: {integrity: sha512-wZ1t7JAvVeFgskH1L9y7c47ITitPytpL0s8FmAT8pVfXcaTmS58ZyoXT+y6cz8uCkQnETjrX3YezTGI18u3ecg==} cpu: [arm64] os: [linux] + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.34': + resolution: {integrity: sha512-NH+FeQWKyuw0k+PbXqpFWNfvD8RPvfJk766B/njdaWz4TmiEcSB0Nb6guNw1rBpM1FmltQYb3fFnTumtC6pRfA==} + cpu: [arm64] + os: [linux] + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.33': resolution: {integrity: sha512-cDndWo3VEYbm7yeujOV6Ie2XHz0K8YX/R/vbNmMo03m1QwtBKKvbYNSyJb3B9+8igltDjd8zNM9mpiNNrq/ekQ==} cpu: [x64] os: [linux] + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.34': + resolution: {integrity: sha512-Q3RSCivp8pNadYK8ke3hLnQk08BkpZX9BmMjgwae2FWzdxhxxUiUzd9By7kneUL0vRQ4uRnhD9VkFQ+Haeqdvw==} + cpu: [x64] + os: [linux] + '@rolldown/binding-linux-x64-musl@1.0.0-beta.33': resolution: {integrity: sha512-bl7uzi6es/l6LT++NZcBpiX43ldLyKXCPwEZGY1rZJ99HQ7m1g3KxWwYCcGxtKjlb2ExVvDZicF6k+96vxOJKg==} cpu: [x64] os: [linux] + '@rolldown/binding-linux-x64-musl@1.0.0-beta.34': + resolution: {integrity: sha512-wDd/HrNcVoBhWWBUW3evJHoo7GJE/RofssBy3Dsiip05YUBmokQVrYAyrboOY4dzs/lJ7HYeBtWQ9hj8wlyF0A==} + cpu: [x64] + os: [linux] + '@rolldown/binding-openharmony-arm64@1.0.0-beta.33': resolution: {integrity: sha512-TrgzQanpLgcmmzolCbYA9BPZgF1gYxkIGZhU/HROnJPsq67gcyaYw/JBLioqQLjIwMipETkn25YY799D2OZzJA==} cpu: [arm64] os: [openharmony] + '@rolldown/binding-openharmony-arm64@1.0.0-beta.34': + resolution: {integrity: sha512-dH3FTEV6KTNWpYSgjSXZzeX7vLty9oBYn6R3laEdhwZftQwq030LKL+5wyQdlbX5pnbh4h127hpv3Hl1+sj8dg==} + cpu: [arm64] + os: [openharmony] + '@rolldown/binding-wasm32-wasi@1.0.0-beta.33': resolution: {integrity: sha512-z0LltdUfvoKak9SuaLz/M9AVSg+RTOZjFksbZXzC6Svl1odyW4ai21VHhZy3m2Faeeb/rl/9efVLayj+qYEGxw==} engines: {node: '>=14.0.0'} cpu: [wasm32] + '@rolldown/binding-wasm32-wasi@1.0.0-beta.34': + resolution: {integrity: sha512-y5BUf+QtO0JsIDKA51FcGwvhJmv89BYjUl8AmN7jqD6k/eU55mH6RJYnxwCsODq5m7KSSTigVb6O7/GqB8wbPw==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.33': resolution: {integrity: sha512-CpvOHyqDNOYx9riD4giyXQDIu72bWRU2Dwt1xFSPlBudk6NumK0OJl6Ch+LPnkp5podQHcQg0mMauAXPVKct7g==} cpu: [arm64] os: [win32] + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.34': + resolution: {integrity: sha512-ga5hFhdTwpaNxEiuxZHWnD3ed0GBAzbgzS5tRHpe0ObptxM1a9Xrq6TVfNQirBLwb5Y7T/FJmJi3pmdLy95ljg==} + cpu: [arm64] + os: [win32] + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.33': resolution: {integrity: sha512-/tNTvZTWHz6HiVuwpR3zR0kGIyCNb+/tFhnJmti+Aw2fAXs3l7Aj0DcXd0646eFKMX8L2w5hOW9H08FXTUkN0g==} cpu: [ia32] os: [win32] + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.34': + resolution: {integrity: sha512-4/MBp9T9eRnZskxWr8EXD/xHvLhdjWaeX/qY9LPRG1JdCGV3DphkLTy5AWwIQ5jhAy2ZNJR5z2fYRlpWU0sIyQ==} + cpu: [ia32] + os: [win32] + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.33': resolution: {integrity: sha512-Bb2qK3z7g2mf4zaKRvkohHzweaP1lLbaoBmXZFkY6jJWMm0Z8Pfnh8cOoRlH1IVM1Ufbo8ZZ1WXp1LbOpRMtXw==} cpu: [x64] os: [win32] + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.34': + resolution: {integrity: sha512-7O5iUBX6HSBKlQU4WykpUoEmb0wQmonb6ziKFr3dJTHud2kzDnWMqk344T0qm3uGv9Ddq6Re/94pInxo1G2d4w==} + cpu: [x64] + os: [win32] + '@rolldown/pluginutils@1.0.0-beta.29': resolution: {integrity: sha512-NIJgOsMjbxAXvoGq/X0gD7VPMQ8j9g0BiDaNjVNVjvl+iKXxL3Jre0v31RmBYeLEmkbj2s02v8vFTbUXi5XS2Q==} '@rolldown/pluginutils@1.0.0-beta.33': resolution: {integrity: sha512-she25NCG6NoEPC/SEB4pHs5STcnfI4VBFOzjeI63maSPrWME5J2XC8ogrBgp8NaE/xzj28/kbpSaebiMvFRj+w==} + '@rolldown/pluginutils@1.0.0-beta.34': + resolution: {integrity: sha512-LyAREkZHP5pMom7c24meKmJCdhf2hEyvam2q0unr3or9ydwDL+DJ8chTF6Av/RFPb3rH8UFBdMzO5MxTZW97oA==} + '@rollup/rollup-android-arm-eabi@4.46.4': resolution: {integrity: sha512-B2wfzCJ+ps/OBzRjeds7DlJumCU3rXMxJJS1vzURyj7+KBHGONm7c9q1TfdBl4vCuNMkDvARn3PBl2wZzuR5mw==} cpu: [arm] @@ -1205,67 +1285,67 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding-darwin-arm64@1.4.11': - resolution: {integrity: sha512-PrmBVhR8MC269jo6uQ+BMy1uwIDx0HAJYLQRQur8gXiehWabUBCRg/d4U9KR7rLzdaSScRyc5JWXR52T7/4MfA==} + '@rspack/binding-darwin-arm64@1.5.0': + resolution: {integrity: sha512-7909YLNnKf0BYxiCpCWOk13WyWS4493Kxk1NQwy9KPLY9ydQExk84KVsix2NuNBaI8Pnk3aVLBPJiSNXtHLjnA==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64@1.4.11': - resolution: {integrity: sha512-YIV8Wzy+JY0SoSsVtN4wxFXOjzxxVPnVXNswrrfqVUTPr9jqGOFYUWCGpbt8lcCgfuBFm6zN8HpOsKm1xUNsVA==} + '@rspack/binding-darwin-x64@1.5.0': + resolution: {integrity: sha512-poGuQsGKCMQqSswgrz8X+frqMVTdmtzUDyvi/p9BLwW+2DwWgmywU8jwE+BYtjfWp1tErBSTlLxmEPQTdcIQgQ==} cpu: [x64] os: [darwin] - '@rspack/binding-linux-arm64-gnu@1.4.11': - resolution: {integrity: sha512-ms6uwECUIcu+6e82C5HJhRMHnfsI+l33v7XQezntzRPN0+sG3EpikEoT7SGbgt4vDwaWLR7wS20suN4qd5r3GA==} + '@rspack/binding-linux-arm64-gnu@1.5.0': + resolution: {integrity: sha512-Bvmk8h3tRhN9UgOtH+vK0SgFM3qEO36eJz7oddOl4lJQxBf2GNA87bGtkMtX+AVPz/PUn7r82uWxrlVNQHAbFg==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.4.11': - resolution: {integrity: sha512-9evq0DOdxMN/H8VM8ZmyY9NSuBgILNVV6ydBfVPMHPx4r1E7JZGpWeKDegZcS5Erw3sS9kVSIxyX78L5PDzzKw==} + '@rspack/binding-linux-arm64-musl@1.5.0': + resolution: {integrity: sha512-bH7UwkbACDYT37YnN9kkhaF9niFFK9ndcdNvYFFr1oUT4W9Ie3V9b41EXijqp3pyh0mDSeeLPFY0aEx1t3e7Pw==} cpu: [arm64] os: [linux] - '@rspack/binding-linux-x64-gnu@1.4.11': - resolution: {integrity: sha512-bHYFLxPPYBOSaHdQbEoCYGMQ1gOrEWj7Mro/DLfSHZi1a0okcQ2Q1y0i1DczReim3ZhLGNrK7k1IpFXCRbAobQ==} + '@rspack/binding-linux-x64-gnu@1.5.0': + resolution: {integrity: sha512-xZ5dwNrE5KtpQyMd9israpJTcTQ3UYUUq23fTcNc79xE5aspkGixDFAYoql4YkhO0O+JWRmdSaFAn6jD+IQWQA==} cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.4.11': - resolution: {integrity: sha512-wrm4E7q2k4+cwT6Uhp6hIQ3eUe/YoaUttj6j5TqHYZX6YeLrNPtD9+ne6lQQ17BV8wmm6NZsmoFIJ5xIptpRhQ==} + '@rspack/binding-linux-x64-musl@1.5.0': + resolution: {integrity: sha512-mv65jYvcyYPkPZJ9kjSvTAcH0o7C5jfICWCQcMmN1tCGD3b8gmf9GqSZ8e+W/JkuvrJ05qTo/PvEq9nhu+pNIg==} cpu: [x64] os: [linux] - '@rspack/binding-wasm32-wasi@1.4.11': - resolution: {integrity: sha512-hiYxHZjaZ17wQtXyLCK0IdtOvMWreGVTiGsaHCxyeT+SldDG+r16bXNjmlqfZsjlfl1mkAqKz1dg+mMX28OTqw==} + '@rspack/binding-wasm32-wasi@1.5.0': + resolution: {integrity: sha512-8rVpl6xfaAFJgo1wCd+emksfl+/8nlehrtkmjY9bj79Ou+kp07L9e1B+UU0jfs8e7aLPntQuF68kzLHwYLzWIQ==} cpu: [wasm32] - '@rspack/binding-win32-arm64-msvc@1.4.11': - resolution: {integrity: sha512-+HF/mnjmTr8PC1dccRt1bkrD2tPDGeqvXC1BBLYd/Klq1VbtIcnrhfmvQM6KaXbiLcY9VWKzcZPOTmnyZ8TaHQ==} + '@rspack/binding-win32-arm64-msvc@1.5.0': + resolution: {integrity: sha512-dWSmNm+GR6WSkOwbhlUcot4Oqwyon+1PRZ9E0vIMFHKGvESf9CQjgHAX0QE9G0kJmRM5x3I16J4x44Kw3W/98Q==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.4.11': - resolution: {integrity: sha512-EU2fQGwrRfwFd/tcOInlD0jy6gNQE4Q3Ayj0Is+cX77sbhPPyyOz0kZDEaQ4qaN2VU8w4Hu/rrD7c0GAKLFvCw==} + '@rspack/binding-win32-ia32-msvc@1.5.0': + resolution: {integrity: sha512-YtOrFEkwhO3Y3sY6Jq0OOYPY7NBTNYuwJ6epTgzPEDGs2cBnwZfzhq0jmD/koWtv1L9+twX95vKosBdauF0tNA==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc@1.4.11': - resolution: {integrity: sha512-1Nc5ZzWqfvE+iJc47qtHFzYYnHsC3awavXrCo74GdGip1vxtksM3G30BlvAQHHVtEmULotWqPbjZpflw/Xk9Ag==} + '@rspack/binding-win32-x64-msvc@1.5.0': + resolution: {integrity: sha512-V4fcPVYWJgDkIkSsFwmUdwC9lkL8+1dzDOwyTWe6KW2MYHF2D148WPHNyVVE6gum12TShpbIsh0j4NiiMhkMtw==} cpu: [x64] os: [win32] - '@rspack/binding@1.4.11': - resolution: {integrity: sha512-maGl/zRwnl0QVwkBCkgjn5PH20L9HdlRIdkYhEsfTepy5x2QZ0ti/0T49djjTJQrqb+S1i6wWQymMMMMMsxx6Q==} + '@rspack/binding@1.5.0': + resolution: {integrity: sha512-UGXQmwEu2gdO+tnGv2q4rOWJdWioy6dlLXeZOLYAZVh3mrfKJhZWtDEygX9hCdE5thWNRTlEvx30QQchJAszIQ==} - '@rspack/cli@1.4.11': - resolution: {integrity: sha512-21/EF/gdtTt03LYtXDFFE9rJNUfpxMtIszGgjfULal3IgYHAjo7mKPp6QlPQLSMi/26+TYHa9WZUrnHf8GUIJg==} + '@rspack/cli@1.5.0': + resolution: {integrity: sha512-M4/fNyoomHbxEbseB2gBbayaCtCLUEcknw5MohDEGaJ+cwVQYKOLga1AI+lpIWwzO5FCRG9tlIxjxa9vNotLeg==} hasBin: true peerDependencies: '@rspack/core': ^1.0.0-alpha || ^1.x - '@rspack/core@1.4.11': - resolution: {integrity: sha512-JtKnL6p7Kc/YgWQJF3Woo4OccbgKGyT/4187W4dyex8BMkdQcbqCNIdi6dFk02hwQzxpOOxRSBI4hlGRbz7oYQ==} - engines: {node: '>=16.0.0'} + '@rspack/core@1.5.0': + resolution: {integrity: sha512-eEtiKV+CUcAtnt1K+eiHDzmBXQcNM8CfCXOzr0+gHGp4w4Zks2B8RF36sYD03MM2bg8VRXXsf0MicQ8FvRMCOg==} + engines: {node: '>=18.12.0'} peerDependencies: '@swc/helpers': '>=0.5.1' peerDependenciesMeta: @@ -4031,6 +4111,10 @@ packages: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} + engines: {node: '>= 6'} + pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} @@ -4243,6 +4327,10 @@ packages: resolution: {integrity: sha512-mgu118ZuRguC8unhPCbdZbyRbjQfEMiWqlojBA5aRIncBelRaBomnHNpGKYkYWeK7twRz5Cql30xgqqrA3Xelw==} hasBin: true + rolldown@1.0.0-beta.34: + resolution: {integrity: sha512-Wwh7EwalMzzX3Yy3VN58VEajeR2Si8+HDNMf706jPLIqU7CxneRW+dQVfznf5O0TWTnJyu4npelwg2bzTXB1Nw==} + hasBin: true + rollup@4.46.4: resolution: {integrity: sha512-YbxoxvoqNg9zAmw4+vzh1FkGAiZRK+LhnSrbSrSXMdZYsRPDWoshcSd/pldKRO6lWzv/e9TiJAVQyirYIeSIPQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -5884,30 +5972,30 @@ snapshots: '@mdn/browser-compat-data@5.7.6': {} - '@module-federation/error-codes@0.17.1': {} + '@module-federation/error-codes@0.18.0': {} - '@module-federation/runtime-core@0.17.1': + '@module-federation/runtime-core@0.18.0': dependencies: - '@module-federation/error-codes': 0.17.1 - '@module-federation/sdk': 0.17.1 + '@module-federation/error-codes': 0.18.0 + '@module-federation/sdk': 0.18.0 - '@module-federation/runtime-tools@0.17.1': + '@module-federation/runtime-tools@0.18.0': dependencies: - '@module-federation/runtime': 0.17.1 - '@module-federation/webpack-bundler-runtime': 0.17.1 + '@module-federation/runtime': 0.18.0 + '@module-federation/webpack-bundler-runtime': 0.18.0 - '@module-federation/runtime@0.17.1': + '@module-federation/runtime@0.18.0': dependencies: - '@module-federation/error-codes': 0.17.1 - '@module-federation/runtime-core': 0.17.1 - '@module-federation/sdk': 0.17.1 + '@module-federation/error-codes': 0.18.0 + '@module-federation/runtime-core': 0.18.0 + '@module-federation/sdk': 0.18.0 - '@module-federation/sdk@0.17.1': {} + '@module-federation/sdk@0.18.0': {} - '@module-federation/webpack-bundler-runtime@0.17.1': + '@module-federation/webpack-bundler-runtime@0.18.0': dependencies: - '@module-federation/runtime': 0.17.1 - '@module-federation/sdk': 0.17.1 + '@module-federation/runtime': 0.18.0 + '@module-federation/sdk': 0.18.0 '@napi-rs/wasm-runtime@1.0.3': dependencies: @@ -5930,8 +6018,12 @@ snapshots: '@oxc-project/runtime@0.82.2': {} + '@oxc-project/runtime@0.82.3': {} + '@oxc-project/types@0.82.2': {} + '@oxc-project/types@0.82.3': {} + '@pkgr/core@0.1.2': {} '@pkgr/core@0.2.9': {} @@ -5948,51 +6040,97 @@ snapshots: '@rolldown/binding-android-arm64@1.0.0-beta.33': optional: true + '@rolldown/binding-android-arm64@1.0.0-beta.34': + optional: true + '@rolldown/binding-darwin-arm64@1.0.0-beta.33': optional: true + '@rolldown/binding-darwin-arm64@1.0.0-beta.34': + optional: true + '@rolldown/binding-darwin-x64@1.0.0-beta.33': optional: true + '@rolldown/binding-darwin-x64@1.0.0-beta.34': + optional: true + '@rolldown/binding-freebsd-x64@1.0.0-beta.33': optional: true + '@rolldown/binding-freebsd-x64@1.0.0-beta.34': + optional: true + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.33': optional: true + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.34': + optional: true + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.33': optional: true + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.34': + optional: true + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.33': optional: true + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.34': + optional: true + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.33': optional: true + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.34': + optional: true + '@rolldown/binding-linux-x64-musl@1.0.0-beta.33': optional: true + '@rolldown/binding-linux-x64-musl@1.0.0-beta.34': + optional: true + '@rolldown/binding-openharmony-arm64@1.0.0-beta.33': optional: true + '@rolldown/binding-openharmony-arm64@1.0.0-beta.34': + optional: true + '@rolldown/binding-wasm32-wasi@1.0.0-beta.33': dependencies: '@napi-rs/wasm-runtime': 1.0.3 optional: true + '@rolldown/binding-wasm32-wasi@1.0.0-beta.34': + dependencies: + '@napi-rs/wasm-runtime': 1.0.3 + optional: true + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.33': optional: true + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.34': + optional: true + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.33': optional: true + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.34': + optional: true + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.33': optional: true + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.34': + optional: true + '@rolldown/pluginutils@1.0.0-beta.29': {} '@rolldown/pluginutils@1.0.0-beta.33': {} + '@rolldown/pluginutils@1.0.0-beta.34': {} + '@rollup/rollup-android-arm-eabi@4.46.4': optional: true @@ -6053,60 +6191,59 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.46.4': optional: true - '@rspack/binding-darwin-arm64@1.4.11': + '@rspack/binding-darwin-arm64@1.5.0': optional: true - '@rspack/binding-darwin-x64@1.4.11': + '@rspack/binding-darwin-x64@1.5.0': optional: true - '@rspack/binding-linux-arm64-gnu@1.4.11': + '@rspack/binding-linux-arm64-gnu@1.5.0': optional: true - '@rspack/binding-linux-arm64-musl@1.4.11': + '@rspack/binding-linux-arm64-musl@1.5.0': optional: true - '@rspack/binding-linux-x64-gnu@1.4.11': + '@rspack/binding-linux-x64-gnu@1.5.0': optional: true - '@rspack/binding-linux-x64-musl@1.4.11': + '@rspack/binding-linux-x64-musl@1.5.0': optional: true - '@rspack/binding-wasm32-wasi@1.4.11': + '@rspack/binding-wasm32-wasi@1.5.0': dependencies: '@napi-rs/wasm-runtime': 1.0.3 optional: true - '@rspack/binding-win32-arm64-msvc@1.4.11': + '@rspack/binding-win32-arm64-msvc@1.5.0': optional: true - '@rspack/binding-win32-ia32-msvc@1.4.11': + '@rspack/binding-win32-ia32-msvc@1.5.0': optional: true - '@rspack/binding-win32-x64-msvc@1.4.11': + '@rspack/binding-win32-x64-msvc@1.5.0': optional: true - '@rspack/binding@1.4.11': + '@rspack/binding@1.5.0': optionalDependencies: - '@rspack/binding-darwin-arm64': 1.4.11 - '@rspack/binding-darwin-x64': 1.4.11 - '@rspack/binding-linux-arm64-gnu': 1.4.11 - '@rspack/binding-linux-arm64-musl': 1.4.11 - '@rspack/binding-linux-x64-gnu': 1.4.11 - '@rspack/binding-linux-x64-musl': 1.4.11 - '@rspack/binding-wasm32-wasi': 1.4.11 - '@rspack/binding-win32-arm64-msvc': 1.4.11 - '@rspack/binding-win32-ia32-msvc': 1.4.11 - '@rspack/binding-win32-x64-msvc': 1.4.11 - - '@rspack/cli@1.4.11(@rspack/core@1.4.11(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3)': + '@rspack/binding-darwin-arm64': 1.5.0 + '@rspack/binding-darwin-x64': 1.5.0 + '@rspack/binding-linux-arm64-gnu': 1.5.0 + '@rspack/binding-linux-arm64-musl': 1.5.0 + '@rspack/binding-linux-x64-gnu': 1.5.0 + '@rspack/binding-linux-x64-musl': 1.5.0 + '@rspack/binding-wasm32-wasi': 1.5.0 + '@rspack/binding-win32-arm64-msvc': 1.5.0 + '@rspack/binding-win32-ia32-msvc': 1.5.0 + '@rspack/binding-win32-x64-msvc': 1.5.0 + + '@rspack/cli@1.5.0(@rspack/core@1.5.0(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3)': dependencies: '@discoveryjs/json-ext': 0.5.7 - '@rspack/core': 1.4.11(@swc/helpers@0.5.17) - '@rspack/dev-server': 1.1.4(@rspack/core@1.4.11(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3) + '@rspack/core': 1.5.0(@swc/helpers@0.5.17) + '@rspack/dev-server': 1.1.4(@rspack/core@1.5.0(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3) colorette: 2.0.20 exit-hook: 4.0.0 - interpret: 3.1.1 - rechoir: 0.8.0 + pirates: 4.0.7 webpack-bundle-analyzer: 4.10.2 yargs: 17.7.2 transitivePeerDependencies: @@ -6118,17 +6255,17 @@ snapshots: - webpack - webpack-cli - '@rspack/core@1.4.11(@swc/helpers@0.5.17)': + '@rspack/core@1.5.0(@swc/helpers@0.5.17)': dependencies: - '@module-federation/runtime-tools': 0.17.1 - '@rspack/binding': 1.4.11 + '@module-federation/runtime-tools': 0.18.0 + '@rspack/binding': 1.5.0 '@rspack/lite-tapable': 1.0.1 optionalDependencies: '@swc/helpers': 0.5.17 - '@rspack/dev-server@1.1.4(@rspack/core@1.4.11(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3)': + '@rspack/dev-server@1.1.4(@rspack/core@1.5.0(@swc/helpers@0.5.17))(@types/express@4.17.23)(webpack-cli@6.0.1)(webpack@5.101.3)': dependencies: - '@rspack/core': 1.4.11(@swc/helpers@0.5.17) + '@rspack/core': 1.5.0(@swc/helpers@0.5.17) chokidar: 3.6.0 http-proxy-middleware: 2.0.9(@types/express@4.17.23) p-retry: 6.2.1 @@ -9298,6 +9435,8 @@ snapshots: pify@4.0.1: {} + pirates@4.0.7: {} + pkg-dir@4.2.0: dependencies: find-up: 4.1.0 @@ -9489,7 +9628,7 @@ snapshots: rfdc@1.4.1: {} - rolldown-plugin-dts@0.15.6(rolldown@1.0.0-beta.33)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2)): + rolldown-plugin-dts@0.15.6(rolldown@1.0.0-beta.34)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2)): dependencies: '@babel/generator': 7.28.3 '@babel/parser': 7.28.3 @@ -9499,7 +9638,7 @@ snapshots: debug: 4.4.1 dts-resolver: 2.1.1 get-tsconfig: 4.10.1 - rolldown: 1.0.0-beta.33 + rolldown: 1.0.0-beta.34 optionalDependencies: typescript: 5.9.2 vue-tsc: 3.0.6(typescript@5.9.2) @@ -9529,6 +9668,28 @@ snapshots: '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.33 '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.33 + rolldown@1.0.0-beta.34: + dependencies: + '@oxc-project/runtime': 0.82.3 + '@oxc-project/types': 0.82.3 + '@rolldown/pluginutils': 1.0.0-beta.34 + ansis: 4.1.0 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-beta.34 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.34 + '@rolldown/binding-darwin-x64': 1.0.0-beta.34 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.34 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.34 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.34 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.34 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.34 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.34 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.34 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.34 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.34 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.34 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.34 + rollup@4.46.4: dependencies: '@types/estree': 1.0.8 @@ -9980,8 +10141,8 @@ snapshots: diff: 8.0.2 empathic: 2.0.0 hookable: 5.5.3 - rolldown: 1.0.0-beta.33 - rolldown-plugin-dts: 0.15.6(rolldown@1.0.0-beta.33)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2)) + rolldown: 1.0.0-beta.34 + rolldown-plugin-dts: 0.15.6(rolldown@1.0.0-beta.34)(typescript@5.9.2)(vue-tsc@3.0.6(typescript@5.9.2)) semver: 7.7.2 tinyexec: 1.0.1 tinyglobby: 0.2.14 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index cfed8c13..e6f18e5b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,8 +6,8 @@ catalog: '@antfu/ni': ^25.0.0 '@farmfe/cli': ^1.0.5 '@farmfe/core': ^1.7.11 - '@rspack/cli': ^1.4.11 - '@rspack/core': ^1.4.11 + '@rspack/cli': ^1.5.0 + '@rspack/core': ^1.5.0 '@types/fs-extra': ^11.0.4 '@types/node': ^24.3.0 '@types/picomatch': ^4.0.2 diff --git a/src/rspack/index.ts b/src/rspack/index.ts index f054efc9..d13cba30 100644 --- a/src/rspack/index.ts +++ b/src/rspack/index.ts @@ -54,9 +54,16 @@ export function getRspackPlugin>( // resolveId hook if (plugin.resolveId) { - const vfs = new FakeVirtualModulesPlugin(plugin) + const createPlugin = (plugin: ResolvedUnpluginOptions) => { + // rspack >= 1.5.0: use native virtual modules plugin + if (compiler.rspack.experiments.VirtualModulesPlugin) + return new compiler.rspack.experiments.VirtualModulesPlugin() + // rspack < 1.5.0: use fake virtual modules plugin + return new FakeVirtualModulesPlugin(plugin) + } + const vfs = createPlugin(plugin) vfs.apply(compiler) - const vfsModules = new Map>() + const vfsModules = new Map>() plugin.__vfsModules = vfsModules plugin.__vfs = vfs as any @@ -102,11 +109,24 @@ export function getRspackPlugin>( if (isExternal) externalModules.add(resolved) + let isVirtual = true + try { + // use the compiler's inputFileSystem if available, otherwise use the node:fs module + (compiler.inputFileSystem?.statSync ?? fs.statSync)(resolved) + isVirtual = false + } + catch { + // already resolved virtual modules are not virtual themselves + isVirtual = !isVirtualModuleId(resolved, plugin) + } + // If the resolved module does not exist, // we treat it as a virtual module - if (!fs.existsSync(resolved)) { + if (isVirtual) { + const encodedVirtualPath = encodeVirtualModuleId(resolved, plugin) + if (!vfsModules.has(resolved)) { - const fsPromise = vfs.writeModule(resolved) + const fsPromise = Promise.resolve(vfs.writeModule(encodedVirtualPath, '')) vfsModules.set(resolved, fsPromise) await fsPromise } @@ -115,7 +135,8 @@ export function getRspackPlugin>( // before we use it. await vfsModules.get(resolved) } - resolved = encodeVirtualModuleId(resolved, plugin) + + resolved = encodedVirtualPath } resolveData.request = resolved diff --git a/src/rspack/utils.ts b/src/rspack/utils.ts index 5ae2fc92..435cc5b7 100644 --- a/src/rspack/utils.ts +++ b/src/rspack/utils.ts @@ -18,19 +18,19 @@ export function isVirtualModuleId(encoded: string, plugin: ResolvedUnpluginOptio export class FakeVirtualModulesPlugin { name = 'FakeVirtualModulesPlugin' static counters: Map = new Map() + static initCleanup: boolean = false - static { - ['SIGINT', 'SIGTERM', 'SIGQUIT', 'exit'].forEach((event) => { - process.once(event, () => { - this.counters.forEach((_, dir) => { + constructor(private plugin: ResolvedUnpluginOptions) { + if (!FakeVirtualModulesPlugin.initCleanup) { + FakeVirtualModulesPlugin.initCleanup = true + process.once('exit', () => { + FakeVirtualModulesPlugin.counters.forEach((_, dir) => { fs.rmSync(dir, { recursive: true, force: true }) }) }) - }) + } } - constructor(private plugin: ResolvedUnpluginOptions) {} - apply(compiler: Compiler): void { const dir = this.plugin.__virtualModulePrefix if (!fs.existsSync(dir)) { @@ -51,9 +51,7 @@ export class FakeVirtualModulesPlugin { }) } - async writeModule(file: string): Promise { - const path = encodeVirtualModuleId(file, this.plugin) - await fs.promises.writeFile(path, '') - return path + async writeModule(file: string): Promise { + return fs.promises.writeFile(file, '') } } diff --git a/src/types.ts b/src/types.ts index a6499f39..5c8e9d49 100644 --- a/src/types.ts +++ b/src/types.ts @@ -147,7 +147,7 @@ export interface UnpluginOptions { export interface ResolvedUnpluginOptions extends UnpluginOptions { // injected internal objects __vfs?: VirtualModulesPlugin | undefined - __vfsModules?: Map> | Set | undefined + __vfsModules?: Map> | Set | undefined __virtualModulePrefix: string }