聽說滿一歲都要抓周,就算不準也要玩一下
但是疫情的關係,不方便到外體驗抓周服務
因此就撰寫了簡單的抓周程式
技術上的分享:
- 本工具是直接使用 ES modules 的 import / export,可以直接引入外部套件,如:swiper, js
- 透過這種方式,HTML 僅會只有單一的進入檔案(all.js),其餘都是外部載入
- 現在許多套件都有提供 ES modules 的形式,如 swiper 可以看到 `esm.browser` 就是給瀏覽器使用的 ES modules
- 目前主流瀏覽器(約 90%)大多可支援 ES modules,不需要另外編譯
如果對於 ES modules 在瀏覽器上的應用
可參考以下範例:
https://github.com/Wcc723/Catch-week/
js modules 在 An Essential Guide to Node.js Modules 的推薦與評價
This tutorial focuses on the CommonJS modules. In CommonJS modules, Node.js treats each JavaScript file as a separate module. Let's take a simple example to see ... ... <看更多>
js modules 在 tc39/proposal-module-expressions - GitHub 的推薦與評價
Whenever developers try to make use of multi-threading in JavaScript — may that be Web Workers, Service Workers, Worklets like CSS Paint API or even other ... ... <看更多>
js modules 在 [譯] 解析Javascript 模組機制與建置函式庫觀念 的推薦與評價
3. UMD (Universal Module Definition) 通用型標準. 結合 CommonJS + AMD 即支援CommonJS 的語法加上AMD 的非同步載入; 可以支援AMD/CommonJS ... ... <看更多>