cloudflare_worker_script 多个文件

huangapple go评论85阅读模式
英文:

cloudflare_worker_script multiple files

问题

使用CloudFlare Web仪表板,可以使用ES模块语法将您的代码拆分为多个文件。它可以直接使用。

是否可以使用CF Terraform提供程序和cloudflare_worker_script创建这样的配置,而不需要像webpack这样的JS捆绑包?

根据他们的文档 ,没有这样的选项。

英文:

Using CloudFlare web dashboard it's possible to split your code into multiple files using ES module syntax. It works out of the box.

cloudflare_worker_script 多个文件

Is it possible to create such configuration using CF Terraform provider and cloudflare_worker_script without JS bundles like webpack?

resource "cloudflare_worker_script" "spainter_script_file_utils" {
  name = "spainter"
  account_id = var.cloud_flare_account_id
  content = file("./workers.js")
  module = true
}

According to their documentation there's no such option

答案1

得分: 1

抱歉,API支持上传其他JavaScript文件作为附加模块,但Terraform提供程序尚未实现该功能,因此它期望您自行使用Webpack、esbuild等打包。

英文:

Unfortunately not - the API supports uploading other JavaScript files as additional modules but the Terraform provider hasn't implemented that so it expects you to bundle yourself using Webpack, esbuild, etc

huangapple
  • 本文由 发表于 2023年6月8日 19:37:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76431468.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定