# egret 官方影片筆記 [Egret Engine(白鹭引擎)5.3系列:巧用Webpack、Eui Compiler提高开发效率](https://www.bilibili.com/video/BV1zz411i7fz/) --- - 08:01 甚麼是 ECMAScript Module - 10:46 模組的優點 - 15:33 如何確保載入順序是可行的 -> 為何 building 很慢 - 17:26 模組的缺點 -> IDE(VSCode)解決 - 19:48 現有專案遷移至 ES6 Module/Webpack - 26:55 處理 `Platform.ts` - 31:23 處理 Egret 找不到入口類別 Main 的問題 在 `Main.ts` 主動暴露 Main 至 window ```typescript= window['Main'] = Main; ``` - 33:25 處理映射問題(`egret.getDefinitionByName`) 可選項目, 主要就是再轉譯當下, 直接在 window 暴露每個 class; - 38:39 循環依賴問題 - 51:23 大絕招 ```typescript= // manager.ts import { ALL_VIEW } from ".typings"; var pool: any = []; export function getView<T extends keyof ALL_VIEW>(name: T): InstanceType<ALL_VIEW[T]> { return pool[name]; } export function setView(clz: any) { const name = clz.name; pool[name] = new clz(); } // model.ts import { getView } from "./manager.ts"; export class Model { constructor() { const view = getView("ViewComponent"); view.updateView(this); console.log(view); } } ``` - 55:22 `EUI Compiler`, 替代 `ExmlPlugin` - 58:16 Tansformer 用途 - 59:34 Emitter 用途 - 結論: 如果沒有要修改 exml 輸出內容的話可以不用, 目前預設也沒開. --- [直播回放 | Egret 5.3新特性(3):改善现有项目开发体验](https://www.bilibili.com/video/BV1oK4y1x7ni) --- - 06:59 編譯模式比較 - 21:34 在現有專案引入3D內容 --- ###### tags: `Egret`