Use npm and wp-env to make production bundle

npm pack can do this for you. You can configure what it puts in the tarball with a .npmignore file or with the files field in package.json.

An example of the files field:

"files": ["*.json", "readme.txt", "my-plugin.php", "build/*"],

With the above in package.json, running npm pack will produce a .tgz with only the files from that list.