MCPcopy Create free account
hub / github.com/webpack/less-loader / Plugin

Class Plugin

test/fixtures/folder/customFileLoaderPlugin.cjs:4–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2const less = require("less");
3
4class Plugin extends less.FileManager {
5 supports(filename) {
6 if (filename === "forFileLoaderPluginResolve.less") {
7 return true;
8 }
9
10 if (filename === "https://fonts.googleapis.com/css?family=Roboto:500") {
11 return true;
12 }
13
14 return false;
15 }
16
17 loadFile(filename, ...args) {
18 let result;
19
20 if (filename === "forFileLoaderPluginResolve.less") {
21 result = path.resolve(__dirname, "../", "file-load-replacement.less");
22 } else if (
23 filename === "https://fonts.googleapis.com/css?family=Roboto:500"
24 ) {
25 result = path.resolve(__dirname, "../", "mock-fonts.less");
26 }
27
28 return super.loadFile(result, ...args);
29 }
30}
31
32class CustomFileLoaderPlugin {
33 install(less, pluginManager) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…