<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/tag/webpack/</link><description>多元化原創文章，內容包羅萬象，有程式語言、網站應用、軟體介紹、硬體介紹、作業系統、旅行遊記、專題採訪、益智問題、文學創作，以及作者們的知識分享和作品分享。</description><language>zh-TW</language><lastBuildDate>Sat, 28 Nov 2026 11:55:00 +0800</lastBuildDate><atom:link href="https://magiclen.org/tag/webpack/feed/" rel="self" type="application/rss+xml"/><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>如何在 Webpack 中使用 TypeScript？</title><link>https://magiclen.org/webpack-typescript/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/08/typescript-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/08/typescript-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/08/typescript-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/08/typescript-660x486.png 3x" alt>
TypeScript 本身沒有將多個模組打包成一個 JavaScript 檔案的功能，也無法最小化、混淆編譯出來的程式，所以要用在網頁瀏覽器上的話，最好交給 Webpack 來打包。這篇文章會說明如何在 TypeScript 專案中加入 Webpack，並用 Babel 載入 TypeScript。]]></description><category>JavaScript</category><category>JavaScript</category><category>node.js</category><category>Webpack</category><category>Babel</category><category>TypeScript</category><guid>https://magiclen.org/webpack-typescript</guid><pubDate>Tue, 14 Jan 2020 12:00:37 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>如何用 Webpack 產生 HTML 網頁？</title><link>https://magiclen.org/webpack-html/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/webpack-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/webpack-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/webpack-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/webpack-660x486.png 3x" alt>
Webpack 除了能打包網頁的靜態資源，也能透過 HTML 模板來產生 HTML 網頁。這篇文章會介紹如何在 Webpack 專案中使用 Handlebars 模板引擎或 React 的 JSX，並搭配「html-webpack-plugin」外掛來產生 HTML 網頁。]]></description><category>研究分享</category><category>HTML</category><category>JavaScript</category><category>HTML</category><category>JavaScript</category><category>node.js</category><category>Handlebars</category><category>Webpack</category><category>React</category><category>JSX</category><category>Babel</category><guid>https://magiclen.org/webpack-html</guid><pubDate>Tue, 1 Oct 2019 12:00:06 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>用 Rust 開發 WebAssembly─第六章：康威生命遊戲的效能</title><link>https://magiclen.org/rust-webassembly-conways-game-of-life-performance/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-660x486.png 3x" alt>
前面花了幾個章節製作的康威生命遊戲，功能已經大致上完成了，不過我們還無法確定其效能是否還有可以優化的空間，必須要用一些方式來偵測才行。]]></description><category>研究分享</category><category>Rust</category><category>WebAssembly</category><category>JavaScript</category><category>HTML</category><category>JavaScript</category><category>node.js</category><category>Rust</category><category>Wasm</category><category>Webpack</category><category>用 Rust 開發 WebAssembly</category><category>康威生命遊戲</category><category>TypeScript</category><guid>https://magiclen.org/rust-webassembly-conways-game-of-life-performance</guid><pubDate>Thu, 19 Sep 2019 12:00:18 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>用 Rust 開發 WebAssembly─第五章：讓康威生命遊戲能與玩家互動</title><link>https://magiclen.org/rust-webassembly-conways-game-of-life-interact/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-660x486.png 3x" alt>
在這個章節中，我們要替康威生命遊戲加入播放、暫停和逐格播放這幾個時間控制的功能，並且讓培養皿中的格子會因玩家滑鼠游標的點擊事件而改變狀態。]]></description><category>研究分享</category><category>Rust</category><category>WebAssembly</category><category>JavaScript</category><category>HTML</category><category>JavaScript</category><category>node.js</category><category>Rust</category><category>Wasm</category><category>Webpack</category><category>用 Rust 開發 WebAssembly</category><category>康威生命遊戲</category><category>TypeScript</category><guid>https://magiclen.org/rust-webassembly-conways-game-of-life-interact</guid><pubDate>Tue, 17 Sep 2019 12:00:01 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>用 Rust 開發 WebAssembly─第四章：測試(Testing)與偵錯(Debugging)</title><link>https://magiclen.org/rust-webassembly-testing-debugging/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-660x486.png 3x" alt>
在開始替我們的康威生命遊戲實作更多功能之前，要先將目前的 Rust 程式加入測試(Testing)，除了可以用來驗證目前的程式正確性之外，還可以避免日後因修改程式而把原本可以正常工作的程式弄出問題了。另外，有些程式問題發生的原因很難確認，我們也需要在 Rust 程式中輸出 Log 到網頁瀏覽器的主控台(console)中，才能偵錯(Debugging)。]]></description><category>研究分享</category><category>Rust</category><category>WebAssembly</category><category>JavaScript</category><category>JavaScript</category><category>node.js</category><category>Rust</category><category>Wasm</category><category>Webpack</category><category>用 Rust 開發 WebAssembly</category><category>康威生命遊戲</category><category>TypeScript</category><guid>https://magiclen.org/rust-webassembly-testing-debugging</guid><pubDate>Sun, 15 Sep 2019 12:00:53 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>用 Rust 開發 WebAssembly─第三章：實作康威生命遊戲</title><link>https://magiclen.org/rust-webassembly-conways-game-of-life/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-660x486.png 3x" alt>
康威生命遊戲（Conway&#39;s Game of Life，又稱康威生命棋）是一個模擬生物細胞存活、繁殖與滅亡的遊戲。雖然這個稱為「遊戲」，但它其實不怎麼好玩，它是透過電腦來模擬出一個培養皿空間，這個培養皿中在一開始會被放置一些虛擬細胞，而這些細胞會遵循一些「遊戲規則」來決定其在下一個階段是持續生存、還是要繁殖、抑或是毀滅。藉由圖像化這個培養皿，我們可以從中觀察到一些有趣(?)的圖像。]]></description><category>研究分享</category><category>Rust</category><category>WebAssembly</category><category>JavaScript</category><category>HTML</category><category>JavaScript</category><category>node.js</category><category>Rust</category><category>Wasm</category><category>Webpack</category><category>用 Rust 開發 WebAssembly</category><category>康威生命遊戲</category><category>TypeScript</category><guid>https://magiclen.org/rust-webassembly-conways-game-of-life</guid><pubDate>Fri, 13 Sep 2019 12:00:43 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>用 Rust 開發 WebAssembly─第二章：將高效能的 Rust 函式庫套用在網頁上</title><link>https://magiclen.org/rust-webassembly-library/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-660x486.png 3x" alt>
在上一章節中，我們有提到 WebAssembly 比 JavaScript 的效能還要快很多，但始終沒有舉出一個例子來比較它們實際的效能差異。在這篇文章中，會介紹如何把任意現有的 Rust 函式庫編譯成 WebAssembly，然後移植到網頁瀏覽器上執行，並且比較 Rust 函式庫做出來的 WebAssembly 模組以及原生 JS 模組在網頁瀏覽器上執行的效能差異。]]></description><category>研究分享</category><category>Rust</category><category>WebAssembly</category><category>JavaScript</category><category>JavaScript</category><category>node.js</category><category>Rust</category><category>ShortCrypt</category><category>Wasm</category><category>Webpack</category><category>用 Rust 開發 WebAssembly</category><category>TypeScript</category><guid>https://magiclen.org/rust-webassembly-library</guid><pubDate>Wed, 11 Sep 2019 12:00:26 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>用 Rust 開發 WebAssembly─第一章：認識 WebAssembly</title><link>https://magiclen.org/rust-webassembly-introduction/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/wasm-ferris-660x486.png 3x" alt>
WebAssembly（簡稱 Wasm），是一個安全、可移植（無硬體和作業系統相依）的低階語言（類似組合語言），由 W3C 制定標準，並由世界四大瀏覽器 Mozilla Firefox、Microsoft Edge、Google Chrome 和 Apple Safari 的提供商共同開發，能用來製作高效能且體積小的程式，通常是應用在 Web 上，但也不限於此。WebAssembly 並不是利用新...]]></description><category>研究分享</category><category>Rust</category><category>WebAssembly</category><category>JavaScript</category><category>HTML</category><category>JavaScript</category><category>node.js</category><category>Rust</category><category>Wasm</category><category>Webpack</category><category>用 Rust 開發 WebAssembly</category><category>TypeScript</category><guid>https://magiclen.org/rust-webassembly-introduction</guid><pubDate>Mon, 9 Sep 2019 12:00:29 +0800</pubDate><dc:creator>Magic Len</dc:creator></item><item><title>如何用 Webpack 來打包 JavaScript、SCSS/CSS、HTML 網頁和任意檔案？</title><link>https://magiclen.org/webpack/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2019/06/webpack-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2019/06/webpack-220x162.png 1x, https://magiclen.org/wp-content/uploads/2019/06/webpack-440x324.png 2x, https://magiclen.org/wp-content/uploads/2019/06/webpack-660x486.png 3x" alt>
Webpack 是 JavaScript 的模組建置工具，運行在 Node.js 上，它可以將零散的 JavaScript 檔案用各式工具優化並打包起來，加快網頁的載入時間。Webpack 也並不限於用在 JavaScript 上，舉凡網頁有用到的靜態資源（如 JS、CSS、圖片檔等），甚至是 HTML 網頁，Webpack 都有辦法打包。]]></description><category>研究分享</category><category>JavaScript</category><category>CSS</category><category>HTML</category><category>JavaScript</category><category>node.js</category><category>Webpack</category><category>SCSS</category><category>Sass</category><category>Font Awesome</category><category>PostCSS</category><category>Vue.js</category><category>Babel</category><guid>https://magiclen.org/webpack</guid><pubDate>Tue, 20 Aug 2019 12:00:16 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>