Skip to content

Commit

Permalink
chore: migrate copy plugin cases (#6362)
Browse files Browse the repository at this point in the history
* chore: migrate copy plugin cases

* chore: migrate copy plugin cases
  • Loading branch information
LingyuCoder authored Apr 25, 2024
1 parent ed09dd1 commit 5afe7f2
Show file tree
Hide file tree
Showing 86 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Thanks to:
- The [Turbopack](https://github.com/vercel/turbo) project which inspired the AST path logic of Rspack.
- The [react-refresh-webpack-plugin](https://github.com/pmmmwh/react-refresh-webpack-plugin) created by [@pmmmwh](https://github.com/pmmmwh), which inspires implement react refresh.
- The [mini-css-extract-plugin] project created by [@sokra](https://github.com/sokra) which inspired implement css extract plugin.
- The [copy-webpack-plugin] project created by [@kevlened](https://github.com/kevlened) which inspired implement copy rspack plugin.

## License

Expand Down
8 changes: 6 additions & 2 deletions plugin-test/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
>**Note**
> This package is heavily based on [mini-css-extract-plugin/test](https://github.com/webpack-contrib/mini-css-extract-plugin/tree/master/test)
> This package is heavily based on
>
> - [mini-css-extract-plugin/test](https://github.com/webpack-contrib/mini-css-extract-plugin/tree/master/test)
> - [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin/tree/master/test)
## Credits

Thanks to:

* The [mini-css-extract-plugin] project created by [@sokra](https://github.com/sokra)
- The [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) project created by [@sokra](https://github.com/sokra)
- The [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) project created by [@kevlened](https://github.com/kevlened)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require("path");
const fs = require("fs");

const rspack = require("../../");
const rspack = require("@rspack/core");

const { run, runEmit, runChange } = require("./helpers/run");

Expand Down
9 changes: 9 additions & 0 deletions plugin-test/copy-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* The test code is modified based on
* https://github.com/webpack-contrib/copy-webpack-plugin/tree/master/test
*
* MIT Licensed
* Author Len Boyette @kevlened
* Copyright JS Foundation and other contributors
* https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/LICENSE
*/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require("path");

const rspack = require("../../../");
const rspack = require("@rspack/core");

module.exports = (config = {}) => {
const fullConfig = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Ideally we pass in patterns and confirm the resulting assets
const fs = require("fs");
const { rspack } = require("@rspack/core");
const AsyncEventIterator = require("../../helpers/AsyncEventIterator");
const AsyncEventIterator = require("./AsyncEventIterator");

const removeIllegalCharacterForWindows = require("./removeIllegalCharacterForWindows");

Expand Down Expand Up @@ -152,7 +152,7 @@ function runForce(opts) {

new PreCopyPlugin({ options: opts }).apply(opts.compiler);

return runEmit(opts).then(() => {});
return runEmit(opts).then(() => { });
}

const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
Expand Down

2 comments on commit 5afe7f2

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Benchmark detail: Open

Name Base (2024-04-25 bc61872) Current Change
10000_development-mode + exec 2.72 s ± 21 ms 2.75 s ± 23 ms +0.84 %
10000_development-mode_hmr + exec 698 ms ± 22 ms 695 ms ± 21 ms -0.40 %
10000_production-mode + exec 2.56 s ± 52 ms 2.57 s ± 52 ms +0.42 %
arco-pro_development-mode + exec 2.5 s ± 105 ms 2.48 s ± 41 ms -0.66 %
arco-pro_development-mode_hmr + exec 431 ms ± 1.9 ms 430 ms ± 1.4 ms -0.30 %
arco-pro_development-mode_hmr_intercept-plugin + exec 445 ms ± 7.1 ms 441 ms ± 2 ms -0.90 %
arco-pro_development-mode_intercept-plugin + exec 3.27 s ± 101 ms 3.25 s ± 95 ms -0.43 %
arco-pro_production-mode + exec 4.09 s ± 73 ms 4.01 s ± 123 ms -1.90 %
arco-pro_production-mode_intercept-plugin + exec 4.82 s ± 72 ms 4.81 s ± 173 ms -0.25 %
threejs_development-mode_10x + exec 2.07 s ± 25 ms 2.06 s ± 18 ms -0.51 %
threejs_development-mode_10x_hmr + exec 758 ms ± 8.4 ms 756 ms ± 15 ms -0.36 %
threejs_production-mode_10x + exec 5.28 s ± 42 ms 5.27 s ± 29 ms -0.30 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Ran ecosystem CI: Open

suite result
modernjs, self-hosted, Linux, ci ✅ success
_selftest, ubuntu-latest ✅ success
nx, ubuntu-latest ✅ success
rspress, ubuntu-latest ✅ success
rsbuild, ubuntu-latest ✅ success
compat, ubuntu-latest ✅ success
examples, ubuntu-latest ✅ success

Please sign in to comment.