MCPcopy Create free account
hub / github.com/webpack/stylus-loader / additionalData

Function additionalData

test/additionalData-option.test.js:27–43  ·  view source on GitHub ↗
(content, loaderContext)

Source from the content-addressed store, hash-verified

25 it("should as a function", async (t) => {
26 const testId = "./additional-data.styl";
27 const additionalData = (content, loaderContext) => {
28 const { resourcePath, rootContext } = loaderContext;
29
30 const relativePath = path.relative(rootContext, resourcePath);
31
32 return `
33/* RelativePath: ${relativePath}; */
34
35color = coral;
36bg = gray;
37
38${content}
39
40.custom-class
41 background: bg
42 `;
43 };
44 const compiler = getCompiler(testId, { additionalData });
45 const stats = await compile(compiler);
46 const codeFromBundle = getCodeFromBundle(stats, compiler);

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…