Pass Command Line Arguments to npm

If you want to pass command line arguments to npm scripts, use the -- separator. Example…

npm run build -- --prefix-paths

This will pass the --prefix-pathsto the build script. Please note the double -- in the command.

Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

Leave a Reply

Your email address will not be published. Required fields are marked *