Giter VIP home page Giter VIP logo

d-webpack-plugin's Introduction

D-Webpack-Plugin

Plugin

重要提示:找不到资料就去看源码和类型定义

compiler: webpack 配置 compilation:能够访问所有的模块和它们的依赖 NormalModuleFactory: 生成模块 compilation 代表这一次资源构建的过程,在 compilation 对象中我们可以通过一系列 API 访问/修改本次打包生成的 module、assets 以及 chunks 。

1、选择一个 Hook

一共分五大类钩子:compiler 钩子、compilation 钩子、ContextModuleFactory Hooks、JavascriptParser Hooks、NormalModuleFactory Hooks https://webpack.docschina.org/api/compiler-hooks/

  • 先想好要在哪个阶段做哪件事
  • 然后去 compiler 找到指定的钩子, 这个钩子一般会返回一个参数, 基本上就是上面五个钩子的信息, 具体 type 去 webpack 仓库找, 因为文档一般不全。
  • 然后再去这个返回的参数中找到具体的方法

2、以什么方式注册事件

tap、tapAsync、tapPromise

参考以下图片即可

图片

image

d-webpack-plugin's People

Contributors

daphnisli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.