2023-01-28

Invalid option in build() call: "watch"

I am following the example as it is described here:

https://bilalbudhani.com/chokidar-esbuild/

When I do:

node esbuild.config.js --watch

I get the message:

[ERROR] Invalid option in build() call: "watch"

I have no idea why this is happening.

Is "watch" not longer a parameter?

I also did this example:

const path = require('path')

require("esbuild").build({
  entryPoints: ["application.js", "client.js"],
  bundle: true,
  sourcemap: true,
  outdir: path.join(process.cwd(), "app/assets/builds"),
  absWorkingDir: path.join(process.cwd(), "app/javascript"),
  minify: true,
  watch: true,
})
.then(() => console.log("⚡Done"))
.catch(() => process.exit(1));

If i remove the line "watch:true", it compiles ok. But if I leave it, I get the same error:

Invalid option in build() call: "watch"

when I do: node esbuild.config.js

Thank you in advance



No comments:

Post a Comment