File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,29 @@ Read in which [`mode`](/configuration/mode/) webpack is running.
466
466
467
467
Possible values: ` ' production' ` , ` ' development' ` , ` ' none' `
468
468
469
+ ### this.utils
470
+
471
+ <Badge text="5.27.0+" />
472
+
473
+ Access to ` contextify ` and ` absolutify ` utilities.
474
+
475
+ - ` contextify ` : Return a new request string avoiding absolute paths when possible.
476
+ - ` absolutify ` : Return a new request string using absolute paths when possible.
477
+
478
+ **my-sync-loader.js**
479
+
480
+ ` ` ` js
481
+ module .exports = function (content ) {
482
+ this .utils .contextify (
483
+ this .context ,
484
+ this .utils .absolutify (this .context , ' ./index.js' )
485
+ );
486
+ this .utils .absolutify (this .context , this .resourcePath );
487
+ // …
488
+ return content ;
489
+ };
490
+ ` ` `
491
+
469
492
## Webpack specific properties
470
493
471
494
The loader interface provides all module relate information. However in rare cases you might need access to the compiler api itself.
You can’t perform that action at this time.
0 commit comments