Hacky access to the Compilation object of webpack.
Hacky access to the Compiler object of webpack.
Hacky access to the Module object being loaded.
The directory of the module. Can be used as context for resolving other stuff. In the example: /abc because resource.js is in this directory
A data object shared between the pitch and the normal phase.
A boolean flag. It is set when in debug mode.
Access to the compilation's inputFileSystem property.
Flag if HMR is enabled
Passed from the last loader. If you would execute the input argument as module, consider reading this variable for a shortcut (for performance).
The index in the loaders array of the current loader. In the example: in loader1: 0, in loader2: 1
loaders = [{request: string, path: string, query: string, module: function}] An array of all the loaders. It is writeable in the pitch phase. In the example: [ { request: "/abc/loader1.js?xyz", path: "/abc/loader1.js", query: "?xyz", module: [Function] }, { request: "/abc/node_modules/loader2/index.js", path: "/abc/node_modules/loader2/index.js", query: "", module: [Function] } ]
Should the result be minimized.
A string or any object. The query of the request for the current loader.
The resolved request string. In the example: "/abc/loader1.js?xyz!/abc/node_modules/loader2/index.js!/abc/resource.js?rrr"
The resource part of the request, including query. In the example: "/abc/resource.js?rrr"
The resource file. In the example: "/abc/resource.js"
The query of the resource. In the example: "?rrr"
Should a SourceMap be generated.
Target of compilation. Passed from configuration options. Example values: "web", "node"
Pass values to the next loader. If you know what your result exports if executed as module, set this value here (as a only element array).
Loader API version. Currently 2. This is useful for providing backwards compatibility. Using the version you can specify custom logic or fallbacks for breaking changes.
This boolean is set to true when this is compiled by webpack.
Loaders were originally designed to also work as Babel transforms. Therefore if you write a loader that works for both, you can use this property to know if there is access to additional loaderContext and webpack features.
Add a directory as dependency of the loader result.
Adds a file as dependency of the loader result in order to make them watchable. For example, html-loader uses this technique as it finds src and src-set attributes. Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
Make this loader async.
Make this loader result cacheable. By default it's not cacheable. A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed. This means the loader shouldn't have other dependencies than specified with this.addDependency. Most loaders are deterministic and cacheable.
Remove all dependencies of the loader result. Even initial dependencies and these of other loaders. Consider using pitch.
Adds a file as dependency of the loader result in order to make them watchable. For example, html-loader uses this technique as it finds src and src-set attributes. Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
Emit a error.
Emit a file. This is webpack-specific.
Emit a warning.
Execute some code fragment like a module.
Don't use require(this.resourcePath), use this function to make loaders chainable!
Resolve a request like a require expression.
Resolve a request like a require expression.
Generated using TypeDoc