Scripts here are related to development workflow of Rspack.
node ./scripts/xxxx.js- Some scripts require executing under the folder of workspace root. Don't worries, they would validate the environment while executing.
Scripts in meta folder are self-contained and shouldn't rely on denpendencis outside the meta folder(especially modules in node_modules). Built-in modules of node are ok to use.
zx is a wonderful tool for Writing scripts using JavaScript.
There are many ways to use zx. The way we recommended is import globals explicitly.
import 'zx/globals';This allow us to execute every script(some of them might not use zx) in this folder by using the same way: node ./scripts/xxxx.js