简体   繁体   中英

hot to run grunt serve with grunt-forever

i use yeoman angular generator and i need to run grunt serve forever (grunt-forever) I tried (gruntfile.js) like these:

grunt.loadNpmTasks('grunt-forever');

grunt.initConfig({
  forever: {
      options: {
          index: 'app/scripts/app.js' (im not sure which file must be here)
      }
    },

 grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'forever:server1:start']);
    }

 grunt.task.run([
  'clean:server',
  'wiredep',
  'concurrent:server',
  'postcss:server',
  'connect:livereload',
  'watch'
 ]);
});

when i try "grunt serve", or "grunt forever:start" - "Verifying property forever.start exists in config...ERROR

Unable to process task. Warning: Required config property "forever.start" missing. Use --force to continue." What should i do?

You can use pm2 for running your application on the server. Check this out; https://github.com/Unitech/pm2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM