配置 google apps script 的开发环境

虽然有线上 IDE,但是不好用,无法分模块开发。bun 的编译速度很快,配置一个开发模板。

首先安装 windows 版本的 bun

windows 版本的 bun 无法进行包安装,可以结合 npm 一起使用。

创建一个空目录 example001

cd example001
bun init
burn run index.ts

# burn install 在 windows 下失败,改用 npm
npm install -D clasp typescript @google/clasp @types/google-apps-script

clasp login

# 创建一个 google sheets,这个 sheets 文件名会以目录名命名
clasp create --type sheets

修改 .clasp.json

修改 rootDir 为编译目录

{
  "scriptId": "xxxxxxxxxxxxxxxxxxxxxx",
  "rootDir": "./dist"
}

修改 package.json,添加编译命令

  "scripts": {
    "build": "bun build ./index.ts --outdir ./dist",
    "push": "clasp push",
    "open": "clasp open", 
    "deploy": "bun run build && bun run push"
  },

测试

bun run deploy
bun run open

其他

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇