MCPcopy Create free account
hub / github.com/webpack/webpack-cli / generatorFor

Function generatorFor

test/create-webpack-app/init/generators.test.js:56–72  ·  view source on GitHub ↗
(template)

Source from the content-addressed store, hash-verified

54 * @returns {Promise<EXPECTED_ANY>} the generator config
55 */
56const generatorFor = async (template) => {
57 const module = await import(pathToFileURL(path.join(LIB, "generators/init", `${template}.js`)));
58
59 let config;
60
61 await module.default({
62 load: async () => {},
63 setDefaultInclude: () => {},
64 setPlopfilePath: () => {},
65 getPlopfilePath: () => path.join(LIB, "plopfile.js"),
66 setGenerator: (name, generatorConfig) => {
67 config = generatorConfig;
68 },
69 });
70
71 return config;
72};
73
74// The action list is built without running any action, so no project is written
75// and nothing is installed.

Callers 1

actionsForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected