Frontend
other|Deno
Deno 環境使用ES modules
Deno 環境使用ES modules
VSCode plugin#

cmd#
- args
deno run main.ts a b -c --quietconsole.log(Deno.args) // [ "a", "b", "-c", "--quiet" ]- automatically be restarted / formatted / tested / bundled.
deno run --watch main.tsdeno test --watchdeno fmt --watch- bundle
deno bundle
<file>output dir
deno bundle main.ts min.jsunit test#
Deno.test …
third-party-module#
Skypack, jspm.io, jsDelivr or esm.sh.
// import dayjs from 'https://cdn.skypack.dev/[email protected]';// import dayjs from 'https://esm.run/dayjs';exmaple#
Managing dependencies#
管理所有載入的套件, Deno沒有像NPM package管理方式, Deno 的解決方式是新增一個檔案(deps.ts)並將所使用到的依賴統一匯入匯出。也可以分成開發依賴、生產依賴
import dayjs from 'https://esm.run/dayjs';
export { dayjs}