custom build error "Command failed with ENOTDIR: npm run build"

Hello, i have a prob with custom build.
Ive been trying to use custom build in esbuild to remove modules for a dev staging.
But i got an error like this.

Running custom build: npm run build
[ERROR] Command failed with ENOTDIR: npm run build
spawn ENOTDIR

could i get some help

// wranger.toml
[env.prod.build]
command = "npm run build"
cwd = "dist/index.js"
watch_dir = "dist/index.js"

// package.json
[script - build]
node ~/[project_path]/esbuild.js
Was this page helpful?