Need to use import statements in worker.js while creating through terraform

I am trying to deploy a Cloudflare worker using terraform. There are several packages that I need to import for my javascript code to work.

Below is the error that I am getting:
Error: error creating worker script: Uncaught SyntaxError: Cannot use import statement outside a module at worker.js:1 (10021)
with cloudflare_worker_script.instance_control
on line 2249, in resource “cloudflare_worker_script” “instance_control”:
resource “cloudflare_worker_script” “instance_control” {