Coder Social home page Coder Social logo

webpack-custom-loader-plugin's Introduction

测试 webpack

在 loaders 内写自定义 loader

loader API

方法名 含义 用法
this.async 异步回调 loader。返回 this.callback const callback = this.async()
this.callback 可以同步或者异步调用的并返回多个结果的函数 this.callback(err, content, sourceMap?, meta?)
this.getOptions(schema) 获取 loader 的 options this.getOptions(schema)
this.emitFile 产生一个文件 this.emitFile(name, content, sourceMap)
this.utils.contextify 返回一个相对路径 this.utils.contextify(context, request)
this.utils.absolutify 返回一个绝对路径 this.utils.absolutify(context, request)

参考文章

在 plugins 内写自定义 plugin

执行 yarn debugger

输入 For help 后面的地址进入 node 地址, 打开控制台点击绿色 node 图标. 这个时候在代码中输入 debugger 就可以打断点调试了

参考文章

compiler hooks

一个 compilation 对象会对构建依赖图中所有模块,进行编译。 在编译阶段,模块会被加载(load)、封存(seal)、优化(optimize)、 分块(chunk)、哈希(hash)和重新创建(restore)

webpack-custom-loader-plugin's People

Contributors

18355166248 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.