mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

npmPathIsJs heuristic doesn't recognize .cjs modules #219

Open TrevorBurnham opened 2 years ago

TrevorBurnham commented 2 years ago

Currently, npm-run-all treats the npm_execpath as a JS file if it ends with .js or .mjs: https://github.com/mysticatea/npm-run-all/blob/bf91f94ce597aa61da37d2e4208ce8c48bc86673/lib/run-task.js#L158

As of pnpm v6, pnpm's npm_execpath is now a .cjs module (release notes), making this heuristic incorrect. Suggested fix: Change the regex from /\.m?js/ to /\.[mc]?js/.