【文件属性】:
文件名称:webpack-loader
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-31 09:52:18
JavaScript
webpack-loader
loader-runner
允许你在不安装 webpack 的情况下运行 loaders.
作用:
作为 webpack 的依赖,webpack 中使用它执行 loader.
进行 loader 的开发和调试.
loader 开发
loader 的参数获取
通过 loader-utils 的 getOptions 方法获取.
const loaderUtils = require('loader-utils');
module.exports = function(source) {
const { name } = loaderUtils.getOptions(this);
};
loader 异常处理
loader 内直接通过 throw 抛出
通过 this.callback 传递错误
this.callback(
err: Error | nu
【文件预览】:
webpack-loader-master
----run-loader.js(459B)
----yarn.lock(2KB)
----src()
--------test-loader.js(576B)
--------async.txt(5B)
--------test.txt(5B)
----LICENSE(1KB)
----README.md(1KB)
----.gitignore(2KB)
----package.json(318B)