generate-plugin.js 436 B

123456789101112131415161718
  1. const yeoman = require("yeoman-environment");
  2. const { PluginGenerator } = require("../generators/plugin-generator");
  3. /**
  4. * Runs a yeoman generator to create a new webpack plugin project
  5. * @returns {void}
  6. */
  7. function pluginCreator() {
  8. const env = yeoman.createEnv();
  9. const generatorName = "webpack-plugin-generator";
  10. env.registerStub(PluginGenerator, generatorName);
  11. env.run(generatorName);
  12. }
  13. module.exports = pluginCreator;