How to use the umi-build-dev/lib/plugins/commands/generate/generators/page function in umi-build-dev

To help you get started, we’ve selected a few umi-build-dev examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lemol / umi-plugin-apollo / src / commands / generate / generators / page / index.js View on Github external
export default api => {
  const PageGenerator = makePageGenerator(api);
  const { paths, config } = api;

  return class Generator extends api.Generator {
    constructor(args, options) {
      super(args, options);
      const pageGeneratorOptions = {
        ...options,
        resolved: require.resolve('umi-build-dev/lib/plugins/commands/generate/generators/page'),
      };
      this.pageGenerator = new PageGenerator(args, pageGeneratorOptions);
    }

    writing() {
      this.pageGenerator.writing();

      const pagePath = this.args[0].toString();