<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 實現Plugin * 創建:webpack在其內部組件創建大量鉤子 * 注冊;插件將自己的方法注冊到對應的鉤子,交給wbepack * 調用:webpack編譯過程,適時地觸發相應的鉤子 ## 流程 * 初始:啟動創建 讀取與合并參數,加載plugin,實例化compiler * 編譯:從entry出發,針對每一個module調用loader 翻譯文件內容并找到module依賴 進行編譯處理 * 輸出:將編譯后的module組合成chunk 將chunk轉化為文件 輸出到文件系統 ~~~ // @file: plugins/myplugin.js const pluginName = 'MyPlugin' // tapable是webpack自帶的package,是webpack的核心實現 // 不需要單獨install,可以在安裝過webpack的項目里直接require // 拿到一個同步hook類 const { SyncHook } = require("tapable"); class MyPlugin { // 傳入webpack config中的plugin配置參數 constructor(options) { // { test: 1 } console.log('@plugin constructor', options); } apply(compiler) { console.log('@plugin apply'); // 實例化自定義事件 compiler.hooks.myPlugin = new SyncHook(['data']) compiler.hooks.environment.tap(pluginName, () => { //廣播自定義事件 compiler.hooks.myPlugin.call("It's my plugin.") console.log('@environment'); }); // compiler.hooks.compilation.tap(pluginName, (compilation) => { // 你也可以在compilation上掛載hook // compilation.hooks.myPlugin = new SyncHook(['data']) // compilation.hooks.myPlugin.call("It's my plugin.") // }); } } module.exports = MyPlugin ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看