generate-loader.js 436 B

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