The properties are added by https://github.com/webpack/loader-runner
loaderRunnerLoaderContext.callback(err?, content?, sourceMap?, additionalData?): void
string | Buffer<ArrayBufferLike>string | RawSourceMap | nullAdditionalDatastringThe directory of the module. Can be used as context for resolving other stuff. eg '/workspaces/ts-loader/examples/vanilla/src'
stringanyEnvironmentTell what kind of ES-features may be used in the generated runtime-code.
Example: arrowFunction: true
numberThe index in the loaders array of the current loader. In the example: in loader1: 0, in loader2: 1
An array of all the loaders. It is writeable in the pitch phase.
loaders = [request: string, path: string, query: string, module: function]
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]
]
stringstring | OptionsTypestringstringstringThe resource inclusive query and fragment. Example: "/abc/resource.js?query#frag"
stringThe resource fragment. Example: "#frag"
stringThe resource path. In the example: "/abc/resource.js"
stringThe resource query string. Example: "?query"
stringTarget of compilation. Example: "web"
loaderRunnerLoaderContext.addContextDependency(context): void
stringAdd a directory as dependency of the loader result.
loaderRunnerLoaderContext.addDependency(file): void
stringAdds 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.
loaderRunnerLoaderContext.addMissingDependency(context): void
stringloaderRunnerLoaderContext.async(): (err?: Error | null, content?: string | Buffer<ArrayBufferLike>, sourceMap?: string | RawSourceMap | null, additionalData?: AdditionalData) => void
(err?: Error | null, content?: string | Buffer<ArrayBufferLike>, sourceMap?: string | RawSourceMap | null, additionalData?: AdditionalData) => voidMake this loader async.
loaderRunnerLoaderContext.cacheable(flag?): void
booleanMake this loader result cacheable. By default it's 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.
loaderRunnerLoaderContext.clearDependencies(): void
Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
loaderRunnerLoaderContext.dependency(file): void
stringalias of addDependency 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.
loaderRunnerLoaderContext.getContextDependencies(): string[]
string[]loaderRunnerLoaderContext.getDependencies(): string[]
string[]loaderRunnerLoaderContext.getMissingDependencies(): string[]
string[]