nuxt-community / adonuxt-template

[Deprecated] Starter template for Nuxt.js with AdonisJS.
451 stars 61 forks source link

nuxt generate #88

Open jamesAtcodeninja opened 6 years ago

jamesAtcodeninja commented 6 years ago

I created a NuxtGenerate ace command with the following code

class NuxtGenerate extends Command {
  /**
   * signature defines the requirements and name
   * of command.
   *
   * @return {String}
   */
  get signature () {
    return 'nuxtGenerate';
  }

  /**
   * description is the little helpful information displayed
   * on the console.
   *
   * @return {String}
   */
  get description () {
    return 'Generate for production the nuxt.js application.';
  }

  /**
   * handle method is invoked automatically by ace, once your
   * command has been executed.
   *
   * @param  {Object} args    [description]
   * @param  {Object} options [description]
   */
  * handle (args, options) {
    const config = Config.get('nuxt');
    config.dev = false;
    config.mode = 'spa';
    this.nuxt = new Nuxt(config);
    const builder = new Builder(this.nuxt);
    this.info('Generating nuxt.js application...');
    yield new Generator(this.nuxt, builder).generate();
  }
}

However, the generated code does not render the HTML from javascript. Has anyone experienced using nuxt generate with adonuxt?

This question is available on Nuxt.js community (#c69)
enero commented 6 years ago

Has a solution been found?